#include <UT_HashGrid.h>
Public Member Functions | |
| UT_HashGrid (fpreal cellsize, const UT_Vector3 &origin, bool fullinit, unsigned int sz=0) | |
| virtual | ~UT_HashGrid () |
| Trivial destructor. | |
| bool | insert (const UT_Vector3 &p, utPtr t) |
| void | findCloseElements (const UT_Vector3 &p, UT_PtrArray< utPtr > &list) |
| void | reset (unsigned int sz=0) |
| void | reset (fpreal cellsize, const UT_Vector3 &origin, bool fullinit, unsigned int sz=0) |
Protected Types | |
| typedef UT_RefArray < UT_HashGridCell< utPtr > > | ut_CellArray |
Protected Member Functions | |
| UT_HashGridCell< utPtr > * | getCell (const UT_Vector3 &p, bool create=false) |
| UT_HashGridCell< utPtr > * | getCell (int i, int j, int k, bool create=false) |
Definition at line 116 of file UT_HashGrid.h.
typedef UT_RefArray<UT_HashGridCell<utPtr> > UT_HashGrid< utPtr >::ut_CellArray [protected] |
Definition at line 166 of file UT_HashGrid.h.
| UT_HashGrid< utPtr >::UT_HashGrid | ( | fpreal | cellsize, | |
| const UT_Vector3 & | origin, | |||
| bool | fullinit, | |||
| unsigned int | sz = 0 | |||
| ) | [inline] |
Constructor takes a floating point value to indicate the size of each grid cell to be stored by the, and optionally takes a size parameter to determine the initial size of the grid cell array. The constructor also requires an origin about which the point set will be roughly centred. fullinit determines whether or not a point is associated with all surrounding grid cells immediately upon addition, or if a point should only ever be associated with one grid cell. In the second case, each query requires that 27 grid cells be checked instead of 1. This is essentially a trade off between the cost of building the data structure and the cost of making point queries. If the number of point queries is likely to outnumber the number of points added to the tree, then fullinit = true is recommended. NOTE: Any points added to the grid after it is constructed must be within 1000000 grid units of the origin.
Definition at line 41 of file UT_HashGrid.C.
| UT_HashGrid< utPtr >::~UT_HashGrid | ( | ) | [inline, virtual] |
| void UT_HashGrid< utPtr >::findCloseElements | ( | const UT_Vector3 & | p, | |
| UT_PtrArray< utPtr > & | list | |||
| ) | [inline] |
Finds all elements close to the given point and returns a list of those elements.
Definition at line 373 of file UT_HashGrid.C.
| UT_HashGridCell< utPtr > * UT_HashGrid< utPtr >::getCell | ( | int | i, | |
| int | j, | |||
| int | k, | |||
| bool | create = false | |||
| ) | [inline, protected] |
Definition at line 700 of file UT_HashGrid.C.
| UT_HashGridCell< utPtr > * UT_HashGrid< utPtr >::getCell | ( | const UT_Vector3 & | p, | |
| bool | create = false | |||
| ) | [inline, protected] |
Helper functions used to get a grid cell from the hash table, or generate a new one if necessary.
Definition at line 664 of file UT_HashGrid.C.
| bool UT_HashGrid< utPtr >::insert | ( | const UT_Vector3 & | p, | |
| utPtr | t | |||
| ) | [inline] |
Inserts a new element in to the set using the given point to determine that element's location in the grid. Returns true if successful.
Definition at line 62 of file UT_HashGrid.C.
| void UT_HashGrid< utPtr >::reset | ( | fpreal | cellsize, | |
| const UT_Vector3 & | origin, | |||
| bool | fullinit, | |||
| unsigned int | sz = 0 | |||
| ) | [inline] |
Additional reset function that also changes the cell width and origin for the structure.
Definition at line 652 of file UT_HashGrid.C.
| void UT_HashGrid< utPtr >::reset | ( | unsigned int | sz = 0 |
) | [inline] |
Resets the structure by clearing all elements from it and optionally reinitializing the cell array to the given size.
Definition at line 637 of file UT_HashGrid.C.
1.5.9