#include <perfect_spatial_hashing.h>
Classes | |
struct | PreImage |
Public Types | |
typedef vcg::Point3i | EntryCoordinate |
typedef vcg::Point3< OffsetType > | Offset |
typedef Offset * | OffsetPointer |
typedef unsigned char | OffsetType |
Public Member Functions | |
void | Allocate (int size) |
void | BuildH1PreImage (const typename UniformGrid::EntryIterator &begin, const typename UniformGrid::EntryIterator &end) |
void | Clear () |
EntryCoordinate | DomainToOffsetTable (const typename UniformGrid::CellCoordinate &coord) |
void | Finalize () |
int | GetNumberOfOccupiedCells () const |
OffsetPointer | GetOffset (const EntryCoordinate &at) const |
OffsetPointer & | GetOffset (const EntryCoordinate &at) |
OffsetPointer | GetOffset (const int i, const int j, const int k) const |
OffsetPointer & | GetOffset (const int i, const int j, const int k) |
void | GetPreImageSortedPerCardinality (std::list< PreImage > &pre_image) |
void | GetRandomOffset (Offset &offset) |
int | GetSize () const |
bool | IsFree (const EntryCoordinate &at) const |
OffsetTable () | |
OffsetPointer | operator[] (const EntryCoordinate &at) const |
OffsetPointer & | operator[] (const EntryCoordinate &at) |
void | SetOffset (const typename UniformGrid::CellCoordinate &coord, const Offset &offset) |
void | SuggestConsistentOffsets (const EntryCoordinate &at, std::vector< Offset > &offsets) |
void | ValidateEntryCoordinate (EntryCoordinate &entry) |
~OffsetTable () | |
Protected Attributes | |
int | m_EntryPerSide |
std::vector< std::vector < std::vector< std::vector < typename UniformGrid::CellCoordinate > > > > | m_H1PreImage |
int | m_NumberOfOccupiedEntries |
std::vector< std::vector < std::vector< OffsetPointer > > > | m_Table |
Static Protected Attributes | |
static const int | m_MAX_VERSOR_LENGTH = 256 |
This class containts the offsets used for shifting the access to the hash table.
Definition at line 665 of file perfect_spatial_hashing.h.
typedef vcg::Point3i vcg::PerfectSpatialHashing< OBJECT_TYPE, SCALAR_TYPE >::OffsetTable::EntryCoordinate |
Definition at line 671 of file perfect_spatial_hashing.h.
typedef vcg::Point3<OffsetType> vcg::PerfectSpatialHashing< OBJECT_TYPE, SCALAR_TYPE >::OffsetTable::Offset |
Definition at line 669 of file perfect_spatial_hashing.h.
typedef Offset* vcg::PerfectSpatialHashing< OBJECT_TYPE, SCALAR_TYPE >::OffsetTable::OffsetPointer |
Definition at line 670 of file perfect_spatial_hashing.h.
typedef unsigned char vcg::PerfectSpatialHashing< OBJECT_TYPE, SCALAR_TYPE >::OffsetTable::OffsetType |
Definition at line 668 of file perfect_spatial_hashing.h.
vcg::PerfectSpatialHashing< OBJECT_TYPE, SCALAR_TYPE >::OffsetTable::OffsetTable | ( | ) | [inline] |
Default constructor
Definition at line 709 of file perfect_spatial_hashing.h.
vcg::PerfectSpatialHashing< OBJECT_TYPE, SCALAR_TYPE >::OffsetTable::~OffsetTable | ( | ) | [inline] |
Destructor
Definition at line 714 of file perfect_spatial_hashing.h.
void vcg::PerfectSpatialHashing< OBJECT_TYPE, SCALAR_TYPE >::OffsetTable::Allocate | ( | int | size | ) | [inline] |
Allocate the space necessary for a offset table containing size entries for each dimension and the necessary space for computing the relative anti-image.
[in] | size | The number of entries per side to allocate. |
Definition at line 739 of file perfect_spatial_hashing.h.
void vcg::PerfectSpatialHashing< OBJECT_TYPE, SCALAR_TYPE >::OffsetTable::BuildH1PreImage | ( | const typename UniformGrid::EntryIterator & | begin, | |
const typename UniformGrid::EntryIterator & | end | |||
) | [inline] |
Build the pre-image of the function: the m_H1PreImage
grid contains, for each cell (i, j, k) a list of the domain grid (the UniformGrid) that are mapped through into that cell.
Definition at line 775 of file perfect_spatial_hashing.h.
void vcg::PerfectSpatialHashing< OBJECT_TYPE, SCALAR_TYPE >::OffsetTable::Clear | ( | void | ) | [inline] |
Clear the entries in the offset table and in the preimage table.
Definition at line 719 of file perfect_spatial_hashing.h.
EntryCoordinate vcg::PerfectSpatialHashing< OBJECT_TYPE, SCALAR_TYPE >::OffsetTable::DomainToOffsetTable | ( | const typename UniformGrid::CellCoordinate & | coord | ) | [inline] |
Converts the coordinate of a given cell in the UniformGrid to a valid entry in the offset table. This function corresponds to the function of the article.
[in] | coord | The index of a domain cell in the UniformGrid. |
coord through this mapping.
Definition at line 850 of file perfect_spatial_hashing.h.
void vcg::PerfectSpatialHashing< OBJECT_TYPE, SCALAR_TYPE >::OffsetTable::Finalize | ( | ) | [inline] |
Definition at line 765 of file perfect_spatial_hashing.h.
int vcg::PerfectSpatialHashing< OBJECT_TYPE, SCALAR_TYPE >::OffsetTable::GetNumberOfOccupiedCells | ( | ) | const [inline] |
Return the number of entries containing a valid offset.
Definition at line 905 of file perfect_spatial_hashing.h.
OffsetPointer vcg::PerfectSpatialHashing< OBJECT_TYPE, SCALAR_TYPE >::OffsetTable::GetOffset | ( | const EntryCoordinate & | at | ) | const [inline] |
Definition at line 914 of file perfect_spatial_hashing.h.
OffsetPointer& vcg::PerfectSpatialHashing< OBJECT_TYPE, SCALAR_TYPE >::OffsetTable::GetOffset | ( | const EntryCoordinate & | at | ) | [inline] |
Definition at line 913 of file perfect_spatial_hashing.h.
OffsetPointer vcg::PerfectSpatialHashing< OBJECT_TYPE, SCALAR_TYPE >::OffsetTable::GetOffset | ( | const int | i, | |
const int | j, | |||
const int | k | |||
) | const [inline] |
Definition at line 911 of file perfect_spatial_hashing.h.
OffsetPointer& vcg::PerfectSpatialHashing< OBJECT_TYPE, SCALAR_TYPE >::OffsetTable::GetOffset | ( | const int | i, | |
const int | j, | |||
const int | k | |||
) | [inline] |
Return the pointer to the offset stored at the given entry. NULL if that entry doesn't contain a offset
Definition at line 910 of file perfect_spatial_hashing.h.
void vcg::PerfectSpatialHashing< OBJECT_TYPE, SCALAR_TYPE >::OffsetTable::GetPreImageSortedPerCardinality | ( | std::list< PreImage > & | pre_image | ) | [inline] |
Sorts the entries of the PreImage table based on their cardinality.
[out] | preimage | The list containing the entries of the preimage sorted by cardinality |
Definition at line 792 of file perfect_spatial_hashing.h.
void vcg::PerfectSpatialHashing< OBJECT_TYPE, SCALAR_TYPE >::OffsetTable::GetRandomOffset | ( | Offset & | offset | ) | [inline] |
Return a random offset: this function is used during the first steps of the creation process, when the offsets are computed at random.
[out] | A | random offset |
Definition at line 877 of file perfect_spatial_hashing.h.
int vcg::PerfectSpatialHashing< OBJECT_TYPE, SCALAR_TYPE >::OffsetTable::GetSize | ( | ) | const [inline] |
Return the number of entries of the offset table for each dimension.
Definition at line 889 of file perfect_spatial_hashing.h.
bool vcg::PerfectSpatialHashing< OBJECT_TYPE, SCALAR_TYPE >::OffsetTable::IsFree | ( | const EntryCoordinate & | at | ) | const [inline] |
Checks if the given entry in the offset table is free
[in] | at | The coordinate of the entry to be checked. |
at
is free. Definition at line 897 of file perfect_spatial_hashing.h.
OffsetPointer vcg::PerfectSpatialHashing< OBJECT_TYPE, SCALAR_TYPE >::OffsetTable::operator[] | ( | const EntryCoordinate & | at | ) | const [inline] |
Definition at line 917 of file perfect_spatial_hashing.h.
OffsetPointer& vcg::PerfectSpatialHashing< OBJECT_TYPE, SCALAR_TYPE >::OffsetTable::operator[] | ( | const EntryCoordinate & | at | ) | [inline] |
Definition at line 916 of file perfect_spatial_hashing.h.
void vcg::PerfectSpatialHashing< OBJECT_TYPE, SCALAR_TYPE >::OffsetTable::SetOffset | ( | const typename UniformGrid::CellCoordinate & | coord, | |
const Offset & | offset | |||
) | [inline] |
Adds a new element to the offset table.
[in] | coord | The index of the UniformGrid cell whose offset has to be stored. |
[in] | offset | The offset to associate to the given UniformGrid cell. |
Definition at line 864 of file perfect_spatial_hashing.h.
void vcg::PerfectSpatialHashing< OBJECT_TYPE, SCALAR_TYPE >::OffsetTable::SuggestConsistentOffsets | ( | const EntryCoordinate & | at, | |
std::vector< Offset > & | offsets | |||
) | [inline] |
Check if the entries in the offset table near the given entry contain a valid offset.
[in] | at | The entry of the offset table whose neighboring entries will be checked. |
[out] | offsets | The set of consistent offset found by inspecting the neighboring entries. |
Definition at line 813 of file perfect_spatial_hashing.h.
void vcg::PerfectSpatialHashing< OBJECT_TYPE, SCALAR_TYPE >::OffsetTable::ValidateEntryCoordinate | ( | EntryCoordinate & | entry | ) | [inline] |
Assures that the given entry can be used to access the offset table without throwing an out-of-bound exception.
[in,out] | entry | The entry to be checked. |
Definition at line 837 of file perfect_spatial_hashing.h.
int vcg::PerfectSpatialHashing< OBJECT_TYPE, SCALAR_TYPE >::OffsetTable::m_EntryPerSide [protected] |
The resolution of the offset table.
Definition at line 921 of file perfect_spatial_hashing.h.
std::vector< std::vector< std::vector< std::vector< typename UniformGrid::CellCoordinate > > > > vcg::PerfectSpatialHashing< OBJECT_TYPE, SCALAR_TYPE >::OffsetTable::m_H1PreImage [protected] |
The pre-image.
Definition at line 924 of file perfect_spatial_hashing.h.
const int vcg::PerfectSpatialHashing< OBJECT_TYPE, SCALAR_TYPE >::OffsetTable::m_MAX_VERSOR_LENGTH = 256 [static, protected] |
The maximal length of the single component of each offset.
Definition at line 920 of file perfect_spatial_hashing.h.
int vcg::PerfectSpatialHashing< OBJECT_TYPE, SCALAR_TYPE >::OffsetTable::m_NumberOfOccupiedEntries [protected] |
The number of entries containing a valid offset.
Definition at line 922 of file perfect_spatial_hashing.h.
std::vector< std::vector< std::vector< OffsetPointer > > > vcg::PerfectSpatialHashing< OBJECT_TYPE, SCALAR_TYPE >::OffsetTable::m_Table [protected] |
The offset table.
Definition at line 923 of file perfect_spatial_hashing.h.