Navigation
API > API/Runtime > API/Runtime/GeometryCore > API/Runtime/GeometryCore/Spatial
References
| Module | GeometryCore |
| Header | /Engine/Source/Runtime/GeometryCore/Public/Spatial/PointHashGrid3.h |
| Include | #include "Spatial/PointHashGrid3.h" |
Syntax
template<typename PointDataType, typename RealType>
class TPointHashGrid3
Remarks
Hash Grid for values associated with 3D 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 3D 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 3D point for the point_data. To Update a point you need to know its old and new 3D coordinates.
Constructors
| Type | Name | Description | |
|---|---|---|---|
TPointHashGrid3
(
RealType cellSize, |
Construct 3D hash grid |
Functions
| Type | Name | Description | |
|---|---|---|---|
| void | EnumeratePointsInBall
(
const TVector< RealType >& QueryPoint, |
Call ProcessPointFunc on all points in grid within a given sphere, or until the function returns false Note: Not thread-safe to update, remove or insert points during enumeration. | |
| TPair< PointDataType, RealType > | FindAnyInRadius
(
const TVector< RealType >& QueryPoint, |
Find any point within radius. | |
| TPair< PointDataType, RealType > | FindAnyInRadius
(
const TVector< RealType >& QueryPoint, |
||
| TPair< PointDataType, RealType > | FindNearestInRadius
(
const TVector< RealType >& QueryPoint, |
||
| TPair< PointDataType, RealType > | FindNearestInRadius
(
const TVector< RealType >& QueryPoint, |
Find nearest point within radius. | |
| int | FindPointsInBall
(
const TVector< RealType >& QueryPoint, |
Find all points in grid within a given sphere. | |
| 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 | IsCellEmpty
(
const TVector< RealType >& Position |
Test if the cell containing Position is empty. | |
| bool | IsCellEmptyUnsafe
(
const TVector< RealType >& Position |
Test if the whole cell containing Position is empty, without locking / thread-safety Can be used to skip a more expensive range search, in some cases. | |
| 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 |