TPointHashGrid2d

Hash Grid for values associated with 2D points.

Windows
MacOS
Linux

References

Module

GeometricObjects

Header

/Engine/Plugins/Experimental/GeometryProcessing/Source/GeometricObjects/Public/Spatial/PointHashGrid2.h

Include

#include "Spatial/PointHashGrid2.h"

Syntax

template<typename PointDataType>
class TPointHashGrid2d

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, ie 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 it's old and new 2D coordinates.

Constructors

Name Description

Public function

TPointHashGrid2d

(
    double cellSize,
    PointDataType InvalidValue
)

Construct 2D hashgrid

Functions

Name Description

Public function Const

TPair< Point...

 

FindNearestInRadius

(
    const FVector2d& QueryPoint,
    double Radius,
    TFunction< double(const PointDataTy...,
    TFunction< bool(const PointDataType...
)

Find nearest point in grid, within a given sphere, without locking / thread-safety.

Public function

void

 

InsertPoint

(
    const PointDataType& Value,
    const FVector2d& Position
)

Insert at given position. This function is thread-safe.

Public function

void

 

InsertPointUnsafe

(
    const PointDataType& Value,
    const FVector2d& Position
)

Insert at given position, without locking / thread-safety

Public function Const

PointDataTyp...

 

InvalidValue()

Invalid grid value

Public function

bool

 

RemovePoint

(
    const PointDataType& Value,
    const FVector2d& Position
)

Remove at given position. This function is thread-safe.

Public function

bool

 

RemovePointUnsafe

(
    const PointDataType& Value,
    const FVector2d& Position
)

Remove at given position, without locking / thread-safety

Public function

void

 

UpdatePoint

(
    const PointDataType& Value,
    const FVector2d& OldPosition,
    const FVector2d& NewPosition
)

Move value from old to new position. This function is thread-safe.

Public function

void

 

UpdatePointUnsafe

(
    const PointDataType& Value,
    const FVector2d& OldPosition,
    const FVector2d& NewPosition
)

Move value from old to new position, without locking / thread-safety

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss