TPointHashGrid3

Hash Grid for values associated with 3D points.

Windows
MacOS
Linux

References

Module

GeometricObjects

Header

/Engine/Plugins/Experimental/GeometryProcessing/Source/GeometricObjects/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

Name Description

Public function

TPointHashGrid3

(
    RealType cellSize,
    PointDataType InvalidValue
)

Construct 3D hash grid

Functions

Name Description

Public function Const

TPair< Point...

 

FindNearestInRadius

(
    const FVector3< RealType >& QueryP...,
    RealType Radius,
    TFunctionRef< RealType(const PointD...,
    TFunctionRef< bool(const PointDataT...
)

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

Public function Const

int

 

FindPointsInBall

(
    const FVector3< RealType >& QueryP...,
    RealType Radius,
    TFunctionRef< RealType(const PointD...,
    TArray< PointDataType >& ResultsOu...,
    TFunctionRef< bool(const PointDataT...
)

Find all points in grid within a given sphere, without locking / thread-safety.

Public function Const

PointDataTyp...

 

GetInvalidValue()

Invalid grid value

Public function

void

 

InsertPoint

(
    const PointDataType& Value,
    const FVector3< RealType >& Positi...
)

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

Public function

void

 

InsertPointUnsafe

(
    const PointDataType& Value,
    const FVector3< RealType >& Positi...
)

Insert at given position, without locking / thread-safety

Public function

bool

 

IsCellEmpty

(
    const FVector3< RealType >& Positi...
)

Test if the cell containing Position is empty.

Public function

bool

 

IsCellEmptyUnsafe

(
    const FVector3< RealType >& Positi...
)

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.

Public function

bool

 

RemovePoint

(
    const PointDataType& Value,
    const FVector3< RealType >& Positi...
)

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

Public function

bool

 

RemovePointUnsafe

(
    const PointDataType& Value,
    const FVector3< RealType >& Positi...
)

Remove at given position, without locking / thread-safety

Public function

void

 

UpdatePoint

(
    const PointDataType& Value,
    const FVector3< RealType >& OldPos...,
    const FVector3< RealType >& NewPos...
)

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

Public function

void

 

UpdatePointUnsafe

(
    const PointDataType& Value,
    const FVector3< RealType >& OldPos...,
    const FVector3< RealType >& NewPos...
)

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