UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
UE::Geometry::FGeometrySet3 Class Reference

#include <GeometrySet3.h>

Classes

struct  FCurve
 
struct  FNearest
 
struct  FPoint
 

Public Member Functions

GEOMETRYCORE_API void Reset (bool bPoints=true, bool bCurves=true)
 
GEOMETRYCORE_API void AddPoint (int PointID, const FVector3d &Position)
 
GEOMETRYCORE_API void AddCurve (int CurveID, const FPolyline3d &Polyline)
 
GEOMETRYCORE_API void RemovePoint (int PointID)
 
GEOMETRYCORE_API void RemoveCurve (int CurveID)
 
GEOMETRYCORE_API void UpdatePoint (int PointID, const FVector3d &Position)
 
GEOMETRYCORE_API void UpdateCurve (int CurveID, const FPolyline3d &Polyline)
 
GEOMETRYCORE_API bool FindNearestPointToRay (const FRay3d &Ray, FNearest &ResultOut, TFunction< bool(const FVector3d &, const FVector3d &)> PointWithinToleranceTest) const
 
GEOMETRYCORE_API bool CollectPointsNearRay (const FRay3d &Ray, TArray< FNearest > &ResultsOut, TFunction< bool(const FVector3d &, const FVector3d &)> PointWithinToleranceTest) const
 
GEOMETRYCORE_API bool FindNearestCurveToRay (const FRay3d &Ray, FNearest &ResultOut, TFunction< bool(const FVector3d &, const FVector3d &)> PointWithinToleranceTest) const
 
GEOMETRYCORE_API bool CollectCurvesNearRay (const FRay3d &Ray, TArray< FNearest > &ResultsOut, TFunction< bool(const FVector3d &, const FVector3d &)> PointWithinToleranceTest) const
 
template<typename PredicateType , typename IntContainerType >
bool FindAllPointsSatisfying (PredicateType Predicate, IntContainerType &PointIDsOut) const
 
template<typename PredicateType , typename IntContainerType >
bool ParallelFindAllPointsSatisfying (PredicateType Predicate, IntContainerType &PointIDsOut) const
 
template<typename PredicateType , typename IntContainerType >
bool FindAllCurvesSatisfying (PredicateType Predicate, IntContainerType &CurveIDsOut) const
 
template<typename PredicateType , typename IntContainerType >
bool ParallelFindAllCurvesSatisfying (PredicateType Predicate, IntContainerType &CurveIDsOut) const
 

Protected Attributes

TArray< FPointPoints
 
TMap< int, int > PointIDToIndex
 
TArray< FCurveCurves
 
TMap< int, int > CurveIDToIndex
 

Detailed Description

FGeometrySet3 stores a set of 3D Points and Polyline curves, and supports spatial queries against these sets.

Since Points and Curves have no area to hit, hit-tests are done via nearest-point-on-ray.

Member Function Documentation

◆ AddCurve()

void FGeometrySet3::AddCurve ( int  CurveID,
const FPolyline3d Polyline 
)

Add a polycurve with given CurveID and the give Polyline

◆ AddPoint()

void FGeometrySet3::AddPoint ( int  PointID,
const FVector3d Position 
)

Add a point with given PointID at the given Position

◆ CollectCurvesNearRay()

bool FGeometrySet3::CollectCurvesNearRay ( const FRay3d Ray,
TArray< FNearest > &  ResultsOut,
TFunction< bool(const FVector3d &, const FVector3d &)>  PointWithinToleranceTest 
) const

Like FindNearestCurveToRay, but gives all elements within tolerance, rather than just the closest.

Parameters
Rayquery ray
ResultsOutpopulated with information about successful nearest point results. Not cleared in advance.
PointWithinToleranceTestshould return true if two 3D points are "close enough" to be considered a hit
Returns
true if at least one result was added (ie, passed PointWithinToleranceTest).
Warning
PointWithinToleranceTest is called in parallel and hence must be thread-safe/re-entrant!

◆ CollectPointsNearRay()

bool FGeometrySet3::CollectPointsNearRay ( const FRay3d Ray,
TArray< FNearest > &  ResultsOut,
TFunction< bool(const FVector3d &, const FVector3d &)>  PointWithinToleranceTest 
) const

Like FindNearestPointToRay, but gives all elements within tolerance, rather than just the closest.

Parameters
Rayquery ray
ResultsOutpopulated with information about successful nearest point results. Not cleared in advance.
PointWithinToleranceTestshould return true if two 3D points are "close enough" to be considered a hit
Returns
true if at least one result was added (ie, passed PointWithinToleranceTest).
Warning
PointWithinToleranceTest is called in parallel and hence must be thread-safe/re-entrant!

◆ FindAllCurvesSatisfying()

bool UE::Geometry::FGeometrySet3::FindAllCurvesSatisfying ( PredicateType  Predicate,
IntContainerType CurveIDsOut 
) const
inline

Fills CurveIDsOut with IDs of curves that satisfy the given predicate.

Parameters
PredicateA lambda or function that takes in a const FPolyline3d& and returns true when the curve's ID should be added to PointIDsOut.
CurveIDsOutOutput list or set. Must have an Add(int) method.

◆ FindAllPointsSatisfying()

bool UE::Geometry::FGeometrySet3::FindAllPointsSatisfying ( PredicateType  Predicate,
IntContainerType PointIDsOut 
) const
inline

Fills PointIDsOut with point IDs of points that satisfy the given predicate.

Parameters
PredicateA lambda or function that takes in a const FVector3d& and returns true when the point's ID should be added to PointIDsOut.
PointIDsOutOutput list or set. Must have an Add(int) method.

◆ FindNearestCurveToRay()

bool FGeometrySet3::FindNearestCurveToRay ( const FRay3d Ray,
FNearest ResultOut,
TFunction< bool(const FVector3d &, const FVector3d &)>  PointWithinToleranceTest 
) const
Parameters
Rayquery ray
ResultOutpopulated with information about successful nearest point result
PointWithinToleranceTestshould return true if two 3D points are "close enough" to be considered a hit
Returns
true if the nearest point on Ray to some curve in the set passed the PointWithinToleranceTest.
Warning
PointWithinToleranceTest is called in parallel and hence must be thread-safe/re-entrant!

◆ FindNearestPointToRay()

bool FGeometrySet3::FindNearestPointToRay ( const FRay3d Ray,
FNearest ResultOut,
TFunction< bool(const FVector3d &, const FVector3d &)>  PointWithinToleranceTest 
) const
Parameters
Rayquery ray
ResultOutpopulated with information about successful nearest point result
PointWithinToleranceTestshould return true if two 3D points are "close enough" to be considered a hit
Returns
true if the nearest point on Ray to some point in the set passed the PointWithinToleranceTest.
Warning
PointWithinToleranceTest is called in parallel and hence must be thread-safe/re-entrant!

◆ ParallelFindAllCurvesSatisfying()

bool UE::Geometry::FGeometrySet3::ParallelFindAllCurvesSatisfying ( PredicateType  Predicate,
IntContainerType CurveIDsOut 
) const
inline

Like FindAllCurvesSatisfying, but parallel, so predicate must be safe to call in parallel.

◆ ParallelFindAllPointsSatisfying()

bool UE::Geometry::FGeometrySet3::ParallelFindAllPointsSatisfying ( PredicateType  Predicate,
IntContainerType PointIDsOut 
) const
inline

Like FindAllPointsSatisfying, but parallel, so predicate must be safe to call in parallel.

◆ RemoveCurve()

void FGeometrySet3::RemoveCurve ( int  CurveID)

Remove a curve with given CurveID.

◆ RemovePoint()

void FGeometrySet3::RemovePoint ( int  PointID)

Remove a point with given PointID.

◆ Reset()

void FGeometrySet3::Reset ( bool  bPoints = true,
bool  bCurves = true 
)
Parameters
bPointsif true, discard all points
bCurvesif true, discard all polycurves

◆ UpdateCurve()

void FGeometrySet3::UpdateCurve ( int  CurveID,
const FPolyline3d Polyline 
)

Update the Polyline of previously-added CurveID

◆ UpdatePoint()

void FGeometrySet3::UpdatePoint ( int  PointID,
const FVector3d Position 
)

Update the Position of previously-added PointID

Member Data Documentation

◆ CurveIDToIndex

TMap<int, int> UE::Geometry::FGeometrySet3::CurveIDToIndex
protected

◆ Curves

TArray<FCurve> UE::Geometry::FGeometrySet3::Curves
protected

◆ PointIDToIndex

TMap<int, int> UE::Geometry::FGeometrySet3::PointIDToIndex
protected

◆ Points

TArray<FPoint> UE::Geometry::FGeometrySet3::Points
protected

The documentation for this class was generated from the following files: