Navigation
API > API/Runtime > API/Runtime/GeometryCore > API/Runtime/GeometryCore/Spatial
References
| Module | GeometryCore |
| Header | /Engine/Source/Runtime/GeometryCore/Public/Spatial/PointHashGrid2.h |
| Include | #include "Spatial/PointHashGrid2.h" |
Syntax
template<typename PointDataType, typename RealType>
class TPointHashGrid2
Remarks
Hash Grid for values associated with 2D points.
This class addresses the situation where you have a list of (point, point_data) and you would like to be able to do efficient proximity queries, i.e. find the nearest point_data for a given query point.
We don't store copies of the 2D points. You provide a point_data type. This could just be the integer index into your list for example, a pointer to something more complex, etc. Insert and Remove functions require you to pass in the 2D point for the point_data. To Update a point you need to know its old and new 2D coordinates.
Constructors
| Type | Name | Description | |
|---|---|---|---|
TPointHashGrid2
(
RealType cellSize, |
Construct 2D hash grid |
Functions
| Type | Name | Description | |
|---|---|---|---|
| TPair< PointDataType, RealType > | FindNearestInRadius
(
const TVector2< RealType >& QueryPoint, |
Find nearest point in grid, within a given sphere, without locking / thread-safety. | |
| PointDataType | Invalid grid value | ||
| void | InsertPoint
(
const PointDataType& Value, |
Insert at given position. This function is thread-safe. | |
| void | InsertPointUnsafe
(
const PointDataType& Value, |
Insert at given position, without locking / thread-safety | |
| bool | RemovePoint
(
const PointDataType& Value, |
Remove at given position. This function is thread-safe. | |
| bool | RemovePointUnsafe
(
const PointDataType& Value, |
Remove at given position, without locking / thread-safety | |
| void | Reserve space in the underlying hash map | ||
| void | UpdatePoint
(
const PointDataType& Value, |
Move value from old to new position. This function is thread-safe. | |
| void | UpdatePointUnsafe
(
const PointDataType& Value, |
Move value from old to new position, without locking / thread-safety |