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

#include <perfect_spatial_hashing.h>

List of all members.

Classes

struct  Data

Public Types

typedef vcg::Point3i EntryCoordinate

Public Member Functions

void Allocate (const int entry_per_side)
void BuildFreeEntryList ()
void Clear (bool delete_vectors=false)
EntryCoordinate DomainToHashTable (const typename UniformGrid::CellCoordinate &p)
void Finalize ()
DataGetData (const EntryCoordinate &at) const
DataGetData (const int i, const int j, const int k) const
std::list< EntryCoordinate > * GetFreeEntryList ()
NeighboringEntryIterator GetNeighborintEntryIterator (const EntryCoordinate &at)
int GetNumberOfFreeEntries ()
int GetNumberOfNotEmptyEntries ()
int GetSize ()
 HashTable ()
bool IsFree (const EntryCoordinate &at) const
Dataoperator[] (const EntryCoordinate &at) const
void SetEntry (const EntryCoordinate &at, std::vector< ObjectPointer > *data)
void ValidateEntry (EntryCoordinate &entry)
 ~HashTable ()

Protected Attributes

int m_EntryPerSide
std::list< EntryCoordinatem_FreeEntries
std::vector< std::vector
< std::vector< Data * > > > 
m_Table

Detailed Description

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

This class substitutes the uniform grid.

Definition at line 457 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 >::HashTable::EntryCoordinate

Definition at line 460 of file perfect_spatial_hashing.h.


Constructor & Destructor Documentation

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

Default constructor

Definition at line 480 of file perfect_spatial_hashing.h.

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

Default destructor

Definition at line 485 of file perfect_spatial_hashing.h.


Member Function Documentation

template<class OBJECT_TYPE , class SCALAR_TYPE >
void vcg::PerfectSpatialHashing< OBJECT_TYPE, SCALAR_TYPE >::HashTable::Allocate ( const int  entry_per_side  )  [inline]

Allocates the space for the hash table; the number of entries created is entry_per_side^3.

Parameters:
[in] entry_per_side The number of entries for each size

Definition at line 498 of file perfect_spatial_hashing.h.

template<class OBJECT_TYPE , class SCALAR_TYPE >
void vcg::PerfectSpatialHashing< OBJECT_TYPE, SCALAR_TYPE >::HashTable::BuildFreeEntryList (  )  [inline]

Inserts each entry in the hash table in the free entry list. When this function is called, each entry in the hash table must be free.

Definition at line 539 of file perfect_spatial_hashing.h.

template<class OBJECT_TYPE , class SCALAR_TYPE >
void vcg::PerfectSpatialHashing< OBJECT_TYPE, SCALAR_TYPE >::HashTable::Clear ( bool  delete_vectors = false  )  [inline]

Removes all the entries from the table and clears the free entry list

Definition at line 554 of file perfect_spatial_hashing.h.

template<class OBJECT_TYPE , class SCALAR_TYPE >
EntryCoordinate vcg::PerfectSpatialHashing< OBJECT_TYPE, SCALAR_TYPE >::HashTable::DomainToHashTable ( const typename UniformGrid::CellCoordinate p  )  [inline]

Maps a given domain entry index into a hash table index. It corresponds to the $f_0$ function in the original article.

Definition at line 581 of file perfect_spatial_hashing.h.

template<class OBJECT_TYPE , class SCALAR_TYPE >
void vcg::PerfectSpatialHashing< OBJECT_TYPE, SCALAR_TYPE >::HashTable::Finalize (  )  [inline]

Definition at line 518 of file perfect_spatial_hashing.h.

template<class OBJECT_TYPE , class SCALAR_TYPE >
Data* vcg::PerfectSpatialHashing< OBJECT_TYPE, SCALAR_TYPE >::HashTable::GetData ( const EntryCoordinate at  )  const [inline]

Definition at line 651 of file perfect_spatial_hashing.h.

template<class OBJECT_TYPE , class SCALAR_TYPE >
Data* vcg::PerfectSpatialHashing< OBJECT_TYPE, SCALAR_TYPE >::HashTable::GetData ( const int  i,
const int  j,
const int  k 
) const [inline]

Return the pointer to the data stored in the hash table at the given position.

Parameters:
[in] at The position of the hash table where looks for the data.
Returns:
A pointer to a valid data only if a valid pointer is stored in the hash table at the given position; otherwise return NULL.

Definition at line 650 of file perfect_spatial_hashing.h.

template<class OBJECT_TYPE , class SCALAR_TYPE >
std::list< EntryCoordinate >* vcg::PerfectSpatialHashing< OBJECT_TYPE, SCALAR_TYPE >::HashTable::GetFreeEntryList (  )  [inline]

Returns the reference to the free entry list

Returns:
The reference to the free entry list

Definition at line 575 of file perfect_spatial_hashing.h.

template<class OBJECT_TYPE , class SCALAR_TYPE >
NeighboringEntryIterator vcg::PerfectSpatialHashing< OBJECT_TYPE, SCALAR_TYPE >::HashTable::GetNeighborintEntryIterator ( const EntryCoordinate at  )  [inline]

Definition at line 491 of file perfect_spatial_hashing.h.

template<class OBJECT_TYPE , class SCALAR_TYPE >
int vcg::PerfectSpatialHashing< OBJECT_TYPE, SCALAR_TYPE >::HashTable::GetNumberOfFreeEntries (  )  [inline]

Returns the number of free entries.

Definition at line 631 of file perfect_spatial_hashing.h.

template<class OBJECT_TYPE , class SCALAR_TYPE >
int vcg::PerfectSpatialHashing< OBJECT_TYPE, SCALAR_TYPE >::HashTable::GetNumberOfNotEmptyEntries (  )  [inline]

Return the number of entries where there is some domain data.

Definition at line 639 of file perfect_spatial_hashing.h.

template<class OBJECT_TYPE , class SCALAR_TYPE >
int vcg::PerfectSpatialHashing< OBJECT_TYPE, SCALAR_TYPE >::HashTable::GetSize (  )  [inline]

Definition at line 626 of file perfect_spatial_hashing.h.

template<class OBJECT_TYPE , class SCALAR_TYPE >
bool vcg::PerfectSpatialHashing< OBJECT_TYPE, SCALAR_TYPE >::HashTable::IsFree ( const EntryCoordinate at  )  const [inline]

Check if a given position in the hash table is free.

Parameters:
[in] at The position of the hash table to check.
Returns:
True if and only if the hash table is free at the given position.

Definition at line 619 of file perfect_spatial_hashing.h.

template<class OBJECT_TYPE , class SCALAR_TYPE >
Data* vcg::PerfectSpatialHashing< OBJECT_TYPE, SCALAR_TYPE >::HashTable::operator[] ( const EntryCoordinate at  )  const [inline]

Definition at line 652 of file perfect_spatial_hashing.h.

template<class OBJECT_TYPE , class SCALAR_TYPE >
void vcg::PerfectSpatialHashing< OBJECT_TYPE, SCALAR_TYPE >::HashTable::SetEntry ( const EntryCoordinate at,
std::vector< ObjectPointer > *  data 
) [inline]

Inserts a new element in the hash table at the given position.

Parameters:
[in] at The position in the hash table where the new element will be created
[in] data The set of the domain elements contained in this entry

Definition at line 595 of file perfect_spatial_hashing.h.

template<class OBJECT_TYPE , class SCALAR_TYPE >
void vcg::PerfectSpatialHashing< OBJECT_TYPE, SCALAR_TYPE >::HashTable::ValidateEntry ( EntryCoordinate entry  )  [inline]

Given a hash table entry, this function modifies its coordinates in order to guarantee that they are in the valid range. Call this function before accessing the hash table.

Parameters:
[in,out] entry The entry whose coordinates have to be checked.

Definition at line 607 of file perfect_spatial_hashing.h.


Member Data Documentation

template<class OBJECT_TYPE , class SCALAR_TYPE >
int vcg::PerfectSpatialHashing< OBJECT_TYPE, SCALAR_TYPE >::HashTable::m_EntryPerSide [protected]

The number of entries for each side of the hash-table.

Definition at line 655 of file perfect_spatial_hashing.h.

template<class OBJECT_TYPE , class SCALAR_TYPE >
std::list< EntryCoordinate > vcg::PerfectSpatialHashing< OBJECT_TYPE, SCALAR_TYPE >::HashTable::m_FreeEntries [protected]

The list containing the free entries.

Definition at line 657 of file perfect_spatial_hashing.h.

template<class OBJECT_TYPE , class SCALAR_TYPE >
std::vector< std::vector< std::vector < Data* > > > vcg::PerfectSpatialHashing< OBJECT_TYPE, SCALAR_TYPE >::HashTable::m_Table [protected]

The table.

Definition at line 656 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