BALL
1.4.79
|
#include <BALL/DATATYPE/hashGrid.h>
Classes | |
class | BoxIteratorTraits |
Public Member Functions | |
Constructors and destructor | |
HashGrid3 () | |
Default constructor. More... | |
HashGrid3 (const Vector3 &origin, Size dimension_x, Size dimension_y, Size dimension_z, float spacing_x, float spacing_y, float spacing_z) | |
HashGrid3 (const Vector3 &origin, Size dimension_x, Size dimension_y, Size dimension_z, float spacing) | |
HashGrid3 (const Vector3 &origin, const Vector3 &size, float spacing) | |
HashGrid3 (const HashGrid3 &grid, bool deep=true) | |
Copy constructor. More... | |
virtual | ~HashGrid3 () |
Destructor. More... | |
virtual void | clear () |
Clears the whole grid. More... | |
void | clear (Position x, Position y, Position z) |
Clears the HashGridBox3 at position (x, y, z) More... | |
void | clear (const Vector3 &vector) |
Clears the HashGridBox3 at position vector More... | |
void | destroy () |
Destroys the grid (obsolete, only calls clear()) More... | |
void | destroy (Position x, Position y, Position z) |
Destroys a box of the grid (obsolete, only calls clear()) More... | |
void | destroy (const Vector3 &vector) |
Destroys a box of the grid (obsolete, only calls clear()) More... | |
Assignment | |
void | set (const Vector3 &origin, const Vector3 &unit, Size dimension_x, Size dimension_y, Size dimension_z) |
assigns the content of a hash grid (obsolete) More... | |
void | set (const Vector3 &origin, float unit, Size size) |
assigns the content of a hash grid (obsolete) More... | |
void | set (const HashGrid3 &grid, bool deep=true) |
assigns the content of a hash grid (obsolete) More... | |
const HashGrid3 & | operator= (const HashGrid3 &grid) |
Assignment operator. More... | |
void | get (Vector3 &origin, Vector3 &unit, Size &dimension_x, Size &dimension_y, Size &dimension_z) const |
void | get (HashGrid3 &grid, bool deep=true) const |
Accessors | |
Size | countNonEmptyBoxes () const |
Counts the non-empty boxes of a grid. More... | |
Size | getSize () const |
Returns the size of a grid, i. e. ????? More... | |
Vector3 & | getOrigin () |
Returns the origin of the grid. More... | |
const Vector3 & | getOrigin () const |
Returns a const reference of the grid origin. More... | |
Vector3 & | getUnit () |
Returns the unit of the grid. More... | |
const Vector3 & | getUnit () const |
Returns the unit of the grid (const version) More... | |
Size | getSizeX () const |
Get the x dimension of the grid. More... | |
Size | getSizeY () const |
Get the y dimension of the grid. More... | |
Size | getSizeZ () const |
Get the z dimension of the grid. More... | |
HashGridBox3< Item > * | getBox (Position x, Position y, Position z) |
Return the HashGridBox3 at position (x, y, z) More... | |
const HashGridBox3< Item > * | getBox (Position x, Position y, Position z) const |
Return the HashGridBox3 at position (x, y, z) (const version) More... | |
HashGridBox3< Item > * | getBox (const Vector3 &vector) |
Return the HashGridBox3 at position vector. More... | |
const HashGridBox3< Item > * | getBox (const Vector3 &vector) const |
Return the HashGridBox3 at position vector (const version) More... | |
bool | getIndices (const HashGridBox3< Item > &box, Position &x, Position &y, Position &z) const |
Get the position indices of a HashGridBox3. More... | |
void | insert (Position x, Position y, Position z, const Item &item) |
Insert an item at position (x, y, z) More... | |
void | insert (const Vector3 &vector, const Item &item) |
Insert an item at position vector More... | |
bool | remove (Position x, Position y, Position z, const Item &item) |
Remove an item from position (x, y ,z) More... | |
bool | remove (const Vector3 &vector, const Item &item) |
Remove an item from position vector More... | |
Miscellaneous | |
void | host (Visitor< HashGrid3 > &visitor) |
Predicates | |
bool | operator== (const HashGrid3 &grid) const |
Equality operator. More... | |
bool | operator!= (const HashGrid3 &grid) const |
Inequality operator. More... | |
bool | isEmpty () const |
Tests, whether this is empty. More... | |
Debugging and Diagnostics | |
virtual bool | isValid () const |
Validity check. More... | |
virtual void | dump (std::ostream &s=std::cout, Size depth=0) const |
Dump the contents of a HashGrid3 to a stream. More... | |
Internal Iterators | |
bool | apply (UnaryProcessor< Item > &processor) |
bool | apply (UnaryProcessor< HashGridBox3< Item > > &processor) |
const Item * | getClosestItem (const Vector3 &point, Size distance) const |
static float | calculateMinSpacing (LongIndex memory, const Vector3 &size) |
External Iterators | |
typedef Position | BoxIteratorPosition |
typedef ForwardIterator < HashGrid3< Item > , HashGridBox3< Item > , BoxIteratorPosition, BoxIteratorTraits > | BoxIterator |
typedef ConstForwardIterator < HashGrid3< Item > , HashGridBox3< Item > , BoxIteratorPosition, BoxIteratorTraits > | ConstBoxIterator |
class | BoxIteratorTraits |
BoxIterator | beginBox () |
BoxIterator | endBox () |
ConstBoxIterator | beginBox () const |
ConstBoxIterator | endBox () const |
Three-dimensional Hash Grid Class. ?????
Definition at line 43 of file hashGrid.h.
typedef ForwardIterator<HashGrid3<Item>, HashGridBox3<Item>, BoxIteratorPosition, BoxIteratorTraits> BALL::HashGrid3< Item >::BoxIterator |
Definition at line 1102 of file hashGrid.h.
typedef Position BALL::HashGrid3< Item >::BoxIteratorPosition |
Definition at line 974 of file hashGrid.h.
typedef ConstForwardIterator<HashGrid3<Item>, HashGridBox3<Item>, BoxIteratorPosition, BoxIteratorTraits> BALL::HashGrid3< Item >::ConstBoxIterator |
Definition at line 1121 of file hashGrid.h.
BALL::HashGrid3< Item >::HashGrid3 | ( | ) |
Default constructor.
Definition at line 1161 of file hashGrid.h.
BALL::HashGrid3< Item >::HashGrid3 | ( | const Vector3 & | origin, |
Size | dimension_x, | ||
Size | dimension_y, | ||
Size | dimension_z, | ||
float | spacing_x, | ||
float | spacing_y, | ||
float | spacing_z | ||
) |
Constructor using origin, dimensions, and spacings of the grid. It creates a hashgrid at origin
with axis-dependant spacings.
origin | |
dimension_x | |
dimension_y | |
dimension_z | |
spacing_x | |
spacing_y | |
spacing_z |
Definition at line 1172 of file hashGrid.h.
BALL::HashGrid3< Item >::HashGrid3 | ( | const Vector3 & | origin, |
Size | dimension_x, | ||
Size | dimension_y, | ||
Size | dimension_z, | ||
float | spacing | ||
) |
Constructor using origin, dimensions, and a single spacing (only cubic grids)
Definition at line 1186 of file hashGrid.h.
BALL::HashGrid3< Item >::HashGrid3 | ( | const Vector3 & | origin, |
const Vector3 & | size, | ||
float | spacing | ||
) |
Constructor using two vectors and a single spacing. This constructor creates a hash grid at origin
with spacing spacing
. The vector size
has to be relative to origin
and defines the opposite corner of the grid, thereby setting the size of the grid.
origin | a vector defining the origin of our cubic hash grid |
size | a vector defining the opposite corner of the cubic grid |
spacing | this float will be used as spacing in all three dimensions |
Definition at line 1199 of file hashGrid.h.
BALL::HashGrid3< Item >::HashGrid3 | ( | const HashGrid3< Item > & | grid, |
bool | deep = true |
||
) |
Copy constructor.
Definition at line 1211 of file hashGrid.h.
|
virtual |
Destructor.
Definition at line 1217 of file hashGrid.h.
bool BALL::HashGrid3< Item >::apply | ( | UnaryProcessor< Item > & | processor | ) |
Definition at line 1694 of file hashGrid.h.
bool BALL::HashGrid3< Item >::apply | ( | UnaryProcessor< HashGridBox3< Item > > & | processor | ) |
Definition at line 1720 of file hashGrid.h.
|
inline |
Definition at line 1105 of file hashGrid.h.
|
inline |
Definition at line 1124 of file hashGrid.h.
|
static |
Calculate the minimum required spacing to build a HashGrid3 with the given size and less than the given memory consumption.
memory | the amount of memory in bytes |
size | the diagonal of the grid |
Definition at line 1461 of file hashGrid.h.
|
virtual |
Clears the whole grid.
Definition at line 1222 of file hashGrid.h.
BALL_INLINE void BALL::HashGrid3< Item >::clear | ( | Position | x, |
Position | y, | ||
Position | z | ||
) |
Clears the HashGridBox3 at position (x, y, z)
Definition at line 1234 of file hashGrid.h.
BALL_INLINE void BALL::HashGrid3< Item >::clear | ( | const Vector3 & | vector | ) |
Clears the HashGridBox3 at position vector
Definition at line 1246 of file hashGrid.h.
Size BALL::HashGrid3< Item >::countNonEmptyBoxes | ( | ) | const |
Counts the non-empty boxes of a grid.
Definition at line 1347 of file hashGrid.h.
BALL_INLINE void BALL::HashGrid3< Item >::destroy | ( | ) |
Destroys the grid (obsolete, only calls clear())
Definition at line 1258 of file hashGrid.h.
BALL_INLINE void BALL::HashGrid3< Item >::destroy | ( | Position | x, |
Position | y, | ||
Position | z | ||
) |
Destroys a box of the grid (obsolete, only calls clear())
Definition at line 1265 of file hashGrid.h.
BALL_INLINE void BALL::HashGrid3< Item >::destroy | ( | const Vector3 & | vector | ) |
Destroys a box of the grid (obsolete, only calls clear())
Definition at line 1272 of file hashGrid.h.
|
virtual |
Dump the contents of a HashGrid3 to a stream.
Definition at line 1646 of file hashGrid.h.
|
inline |
Definition at line 1111 of file hashGrid.h.
|
inline |
Definition at line 1130 of file hashGrid.h.
BALL_INLINE void BALL::HashGrid3< Item >::get | ( | Vector3 & | origin, |
Vector3 & | unit, | ||
Size & | dimension_x, | ||
Size & | dimension_y, | ||
Size & | dimension_z | ||
) | const |
Definition at line 1328 of file hashGrid.h.
BALL_INLINE void BALL::HashGrid3< Item >::get | ( | HashGrid3< Item > & | grid, |
bool | deep = true |
||
) | const |
Definition at line 1340 of file hashGrid.h.
BALL_INLINE HashGridBox3< Item > * BALL::HashGrid3< Item >::getBox | ( | Position | x, |
Position | y, | ||
Position | z | ||
) |
Return the HashGridBox3 at position (x, y, z)
Definition at line 1471 of file hashGrid.h.
BALL_INLINE const HashGridBox3< Item > * BALL::HashGrid3< Item >::getBox | ( | Position | x, |
Position | y, | ||
Position | z | ||
) | const |
Return the HashGridBox3 at position (x, y, z) (const version)
Definition at line 1487 of file hashGrid.h.
BALL_INLINE HashGridBox3< Item > * BALL::HashGrid3< Item >::getBox | ( | const Vector3 & | vector | ) |
Return the HashGridBox3 at position vector.
Definition at line 1494 of file hashGrid.h.
BALL_INLINE const HashGridBox3< Item > * BALL::HashGrid3< Item >::getBox | ( | const Vector3 & | vector | ) | const |
Return the HashGridBox3 at position vector (const version)
Definition at line 1510 of file hashGrid.h.
const Item * BALL::HashGrid3< Item >::getClosestItem | ( | const Vector3 & | point, |
Size | distance | ||
) | const |
Get the nearest item for a point
distance | number of adjacted boxes in each direction to search in |
Definition at line 1417 of file hashGrid.h.
BALL_INLINE bool BALL::HashGrid3< Item >::getIndices | ( | const HashGridBox3< Item > & | box, |
Position & | x, | ||
Position & | y, | ||
Position & | z | ||
) | const |
Get the position indices of a HashGridBox3.
Definition at line 1518 of file hashGrid.h.
BALL_INLINE Vector3 & BALL::HashGrid3< Item >::getOrigin | ( | ) |
Returns the origin of the grid.
Definition at line 1369 of file hashGrid.h.
BALL_INLINE const Vector3 & BALL::HashGrid3< Item >::getOrigin | ( | ) | const |
Returns a const reference of the grid origin.
Definition at line 1376 of file hashGrid.h.
BALL_INLINE Size BALL::HashGrid3< Item >::getSize | ( | ) | const |
Returns the size of a grid, i. e. ?????
Definition at line 1362 of file hashGrid.h.
BALL_INLINE Size BALL::HashGrid3< Item >::getSizeX | ( | ) | const |
Get the x dimension of the grid.
Definition at line 1397 of file hashGrid.h.
BALL_INLINE Size BALL::HashGrid3< Item >::getSizeY | ( | ) | const |
Get the y dimension of the grid.
Definition at line 1404 of file hashGrid.h.
BALL_INLINE Size BALL::HashGrid3< Item >::getSizeZ | ( | ) | const |
Get the z dimension of the grid.
Definition at line 1411 of file hashGrid.h.
BALL_INLINE Vector3 & BALL::HashGrid3< Item >::getUnit | ( | ) |
Returns the unit of the grid.
Definition at line 1383 of file hashGrid.h.
BALL_INLINE const Vector3 & BALL::HashGrid3< Item >::getUnit | ( | ) | const |
Returns the unit of the grid (const version)
Definition at line 1390 of file hashGrid.h.
BALL_INLINE void BALL::HashGrid3< Item >::host | ( | Visitor< HashGrid3< Item > > & | visitor | ) |
Definition at line 1593 of file hashGrid.h.
BALL_INLINE void BALL::HashGrid3< Item >::insert | ( | Position | x, |
Position | y, | ||
Position | z, | ||
const Item & | item | ||
) |
Insert an item at position (x, y, z)
Definition at line 1541 of file hashGrid.h.
BALL_INLINE void BALL::HashGrid3< Item >::insert | ( | const Vector3 & | vector, |
const Item & | item | ||
) |
Insert an item at position vector
Definition at line 1553 of file hashGrid.h.
BALL_INLINE bool BALL::HashGrid3< Item >::isEmpty | ( | ) | const |
Tests, whether this
is empty.
Definition at line 1624 of file hashGrid.h.
|
virtual |
Validity check.
Definition at line 1630 of file hashGrid.h.
BALL_INLINE bool BALL::HashGrid3< Item >::operator!= | ( | const HashGrid3< Item > & | grid | ) | const |
Inequality operator.
Definition at line 1617 of file hashGrid.h.
BALL_INLINE const HashGrid3< Item > & BALL::HashGrid3< Item >::operator= | ( | const HashGrid3< Item > & | grid | ) |
Assignment operator.
Definition at line 1319 of file hashGrid.h.
BALL_INLINE bool BALL::HashGrid3< Item >::operator== | ( | const HashGrid3< Item > & | grid | ) | const |
Equality operator.
Definition at line 1600 of file hashGrid.h.
BALL_INLINE bool BALL::HashGrid3< Item >::remove | ( | Position | x, |
Position | y, | ||
Position | z, | ||
const Item & | item | ||
) |
Remove an item from position (x, y ,z)
Definition at line 1565 of file hashGrid.h.
BALL_INLINE bool BALL::HashGrid3< Item >::remove | ( | const Vector3 & | vector, |
const Item & | item | ||
) |
Remove an item from position vector
Definition at line 1579 of file hashGrid.h.
void BALL::HashGrid3< Item >::set | ( | const Vector3 & | origin, |
const Vector3 & | unit, | ||
Size | dimension_x, | ||
Size | dimension_y, | ||
Size | dimension_z | ||
) |
assigns the content of a hash grid (obsolete)
Definition at line 1279 of file hashGrid.h.
void BALL::HashGrid3< Item >::set | ( | const Vector3 & | origin, |
float | unit, | ||
Size | size | ||
) |
assigns the content of a hash grid (obsolete)
Definition at line 1291 of file hashGrid.h.
void BALL::HashGrid3< Item >::set | ( | const HashGrid3< Item > & | grid, |
bool | deep = true |
||
) |
assigns the content of a hash grid (obsolete)
Definition at line 1302 of file hashGrid.h.
|
friend |
Definition at line 1096 of file hashGrid.h.