FLidarPointCloudOctree

Used for efficient handling of point cloud data.

Choose your operating system:

Windows

macOS

Linux

References

Module

LidarPointCloudRuntime

Header

/Engine/Plugins/Enterprise/LidarPointCloud/Source/LidarPointCloudRuntime/Public/LidarPointCloudOctree.h

Include

#include "LidarPointCloudOctree.h"

Syntax

class FLidarPointCloudOctree

Remarks

Used for efficient handling of point cloud data.

Variables

Name Description

Public variable

FCriticalSectio...

 

DataLock

Used for thread safety between rendering and asset operations.

Public variable

FCriticalSectio...

 

DataReleaseLock

Used to prevent auto-release of nodes if they are in use by other threads

Constructors

Destructors

Name Description

Public function

~FLidarPointCloudOctree()

Functions

Name Description

Public function

void

 

ApplyColorToAllPoints

(
    const FColor& NewColor,
    const bool& bVisibleOnly
)

Applies the given color to all points

Public function

void

 

ApplyColorToFirstPointByRay

(
    const FColor& NewColor,
    const FLidarPointCloudRay& Ray,
    const float& Radius,
    bool bVisibleOnly
)

Applies the given color to the first point hit by the given ray

Public function

void

 

ApplyColorToPointsByRay

(
    const FColor& NewColor,
    const FLidarPointCloudRay& Ray,
    const float& Radius,
    bool bVisibleOnly
)

Applies the given color to all points hit by the given ray

Public function

void

 

ApplyColorToPointsInBox

(
    const FColor& NewColor,
    const FBox& Box,
    const bool& bVisibleOnly
)

Applies the given color to all points within the box

Public function

void

 

ApplyColorToPointsInSphere

(
    const FColor& NewColor,
    const FSphere& Sphere,
    const bool& bVisibleOnly
)

Applies the given color to all points within the sphere

Public function

void

 

BuildCollision

(
    const float& Accuracy,
    const bool& bVisibleOnly
)

Builds collision using the accuracy provided

Public function

void

 

CalculateNormals

(
    FThreadSafeBool* bCancelled,
    int32 Quality,
    float Tolerance,
    TArray64< FLidarPointCloudPoint...
)

Calculates Normals for the provided points If a nullptr is passed, the calculation will be executed on the whole cloud

Public function

void

 

Empty

(
    bool bDestroyNodes
)

Removes all points and, optionally, all nodes except for the root node. Retains the bounds.

Public function

void

 

ExecuteActionOnAllPoints

(
    TFunction< void...,
    const bool& bVisibleOnly
)

Executes the provided action on each of the points.

Public function

void

 

ExecuteActionOnFirstPointByRay

(
    TFunction< void...,
    const FLidarPointCloudRay& Ray,
    const float& Radius,
    bool bVisibleOnly
)

Executes the provided action on the first point hit by the given ray.

Public function

void

 

ExecuteActionOnPointsByRay

(
    TFunction< void...,
    const FLidarPointCloudRay& Ray,
    const float& Radius,
    bool bVisibleOnly
)

Executes the provided action on each of the points hit by the given ray.

Public function

void

 

ExecuteActionOnPointsInBox

(
    TFunction< void...,
    const FBox& Box,
    const bool& bVisibleOnly
)

Executes the provided action on each of the points within the given box.

Public function

void

 

ExecuteActionOnPointsInSphere

(
    TFunction< void...,
    const FSphere& Sphere,
    const bool& bVisibleOnly
)

Executes the provided action on each of the points within the given sphere.

Public function Const

int64

 

GetAllocatedSize()

Returns the amount of memory used by this Octree, including the BulkData

Public function Const

int64

 

GetAllocatedStructureSize()

Returns the amount of memory used by this Octree, excluding the BulkData

Public function Const

FBox

 

GetBounds()

Returns the Cloud bounds.

Public function Const

const FTriMe...

 

GetCollisionData()

Returns pointer to the collision data

Public function Const

float

 

GetEstimatedPointSpacing()

Returns an estimated spacing between points

Public function Const

FVector

 

GetExtent()

Returns the extent of the Cloud's bounds.

Public function Const

int32

 

GetNumLODs()

Returns the number of different LODs.

Public function Const

int32

 

GetNumNodes()

Returns the total number of nodes.

Public function Const

int32

 

GetNumNodesInUse()

Returns the total number of nodes.

Public function Const

int64

 

GetNumPoints()

Returns the total number of points.

Public function Const

int64

 

GetNumVisiblePoints()

Returns the total number of visible points.

Public function Const

ULidarPointC...

 

GetOwner()

Returns a pointer to the Point Cloud asset, which owns this Octree.

Public function

void

 

GetPoints

(
    TArray64< FLidarPointCloudPoint...,
    int64 StartIndex,
    int64 Count
)

Populates the given array with points from the tree

Public function

void

 

GetPoints

(
    TArray< FLidarPointCloudPoint*...,
    int64 StartIndex,
    int64 Count
)

Populates the given array with points from the tree

Public function Const

void

 

GetPointsAsCopies

(
    TArray64< FLidarPointCloudPoint >&...,
    const FTransform* LocalToWorld,
    int64 StartIndex,
    int64 Count
)

Populates the given array with copies of points from the tree

Public function Const

void

 

GetPointsAsCopies

(
    TArray< FLidarPointCloudPoint >& S...,
    const FTransform* LocalToWorld,
    int64 StartIndex,
    int64 Count
)

Populates the given array with copies of points from the tree

Public function

void

 

GetPointsAsCopiesInBatches()

Executes the provided action on batches of points.

Public function

void

 

GetPointsInBox

(
    TArray< FLidarPointCloudPoint*...,
    const FBox& Box,
    const bool& bVisibleOnly
)

Populates the array with the list of pointers to points within the given box.

Public function Const

void

 

GetPointsInBox

(
    TArray64< const FLidarPointCloudPoi...,
    const FBox& Box,
    const bool& bVisibleOnly
)

Populates the array with the list of pointers to points within the given box.

Public function Const

void

 

GetPointsInBox

(
    TArray< const FLidarPointCloudPoint...,
    const FBox& Box,
    const bool& bVisibleOnly
)

Populates the array with the list of pointers to points within the given box.

Public function

void

 

GetPointsInBox

(
    TArray64< FLidarPointCloudPoint...,
    const FBox& Box,
    const bool& bVisibleOnly
)

Populates the array with the list of pointers to points within the given box.

Public function Const

void

 

GetPointsInBoxAsCopies

(
    TArray64< FLidarPointCloudPoint >&...,
    const FBox& Box,
    const bool& bVisibleOnly,
    const FTransform* LocalToWorld
)

Populates the array with the list of pointers to points within the given box.

Public function Const

void

 

GetPointsInBoxAsCopies

(
    TArray< FLidarPointCloudPoint >& S...,
    const FBox& Box,
    const bool& bVisibleOnly,
    const FTransform* LocalToWorld
)

Populates the array with the list of pointers to points within the given box.

Public function

void

 

GetPointsInConvexVolume

(
    TArray< FLidarPointCloudPoint*...,
    const FConvexVolume& ConvexVolume,
    const bool& bVisibleOnly
)

Populates the array with the list of points within the given convex volume.

Public function

void

 

GetPointsInConvexVolume

(
    TArray64< FLidarPointCloudPoint...,
    const FConvexVolume& ConvexVolume,
    const bool& bVisibleOnly
)

Populates the array with the list of points within the given convex volume.

Public function

void

 

GetPointsInSphere

(
    TArray64< FLidarPointCloudPoint...,
    const FSphere& Sphere,
    const bool& bVisibleOnly
)

Populates the array with the list of points within the given sphere.

Public function

void

 

GetPointsInSphere

(
    TArray< FLidarPointCloudPoint*...,
    const FSphere& Sphere,
    const bool& bVisibleOnly
)

Populates the array with the list of points within the given sphere.

Public function Const

void

 

GetPointsInSphereAsCopies

(
    TArray64< FLidarPointCloudPoint >&...,
    const FSphere& Sphere,
    const bool& bVisibleOnly,
    const FTransform* LocalToWorld
)

Populates the array with the list of points within the given sphere.

Public function Const

void

 

GetPointsInSphereAsCopies

(
    TArray< FLidarPointCloudPoint >& S...,
    const FSphere& Sphere,
    const bool& bVisibleOnly,
    const FTransform* LocalToWorld
)

Populates the array with the list of points within the given sphere.

Public function Const

float

 

GetRootCellSize()

Returns the grid cell size at root level.

Public function Const

bool

 

HasCollisionData()

Returns true, if the Octree has collision built

Public function Const

bool

 

HasData()

Returns true if the Root node exists and has any data assigned.

Public function Const

bool

 

HasPointsByRay

(
    const FLidarPointCloudRay& Ray,
    const float& Radius,
    const bool& bVisibleOnly
)

Returns true if there are any points hit by the given ray.

Public function Const

bool

 

HasPointsInBox

(
    const FBox& Box,
    const bool& bVisibleOnly
)

Returns true if there are any points within the given box.

Public function Const

bool

 

HasPointsInSphere

(
    const FSphere& Sphere,
    const bool& bVisibleOnly
)

Returns true if there are any points within the given sphere.

Public function

void

 

HideAll()

Marks all points hidden

Public function

void

 

Initialize

(
    const FVector& InExtent
)

Initializes the Octree properties.

Public function

void

 

InsertPoint

(
    const FLidarPointCloudPoint* P...,
    ELidarPointCloudDuplicateHandling D...,
    bool bRefreshPointsBounds,
    const FVector& Translation
)

Inserts the given point into the Octree structure, internally thread-safe.

Public function

void

 

InsertPoints

(
    FLidarPointCloudPoint** Po...,
    const int64& Count,
    ELidarPointCloudDuplicateHandling D...,
    bool bRefreshPointsBounds,
    const FVector& Translation
)

Inserts group of points into the Octree structure, internally thread-safe.

Public function

void

 

InsertPoints

(
    const FLidarPointCloudPoint* P...,
    const int64& Count,
    ELidarPointCloudDuplicateHandling D...,
    bool bRefreshPointsBounds,
    const FVector& Translation
)

Inserts group of points into the Octree structure, internally thread-safe.

Public function

void

 

InsertPoints

(
    FLidarPointCloudPoint* Points,
    const int64& Count,
    ELidarPointCloudDuplicateHandling D...,
    bool bRefreshPointsBounds,
    const FVector& Translation
)

Inserts group of points into the Octree structure, internally thread-safe.

Public function Const

bool

 

IsFullyLoaded()

Returns true, if the cloud is fully and persistently loaded.

Public function Const

bool

 

IsOptimizedForDynamicData()

Public function

void

 

LoadAllNodes

(
    bool bLoadPersistently
)

Loads all nodes.

Public function

void

 

MarkPointVisibilityDirty()

This should to be called if any manual modification to individual points' visibility has been made.

Public function

void

 

MarkRenderDataDirty()

Marks render data of all nodes as dirty.

Public function

void

 

MarkRenderDataInConvexVolumeDirty

(
    const FConvexVolume& ConvexVolume
)

Marks render data of all nodes within the given convex volume as dirty.

Public function

void

 

MarkRenderDataInSphereDirty

(
    const FSphere& Sphere
)

Marks render data of all nodes within the given sphere as dirty.

Public function

void

 

OptimizeForDynamicData()

Public function

void

 

OptimizeForStaticData()

Public function

bool

 

RaycastMulti

(
    const FLidarPointCloudRay& Ray,
    const float& Radius,
    const bool& bVisibleOnly,
    TArray< FLidarPointCloudPoint*...
)

Performs a raycast test against the point cloud.

Public function

bool

 

RaycastMulti

(
    const FLidarPointCloudRay& Ray,
    const float& Radius,
    const bool& bVisibleOnly,
    const FTransform* LocalToWorld,
    TArray< FLidarPointCloudPoint >& O...
)

Performs a raycast test against the point cloud.

Public function

FLidarPointC...

 

RaycastSingle

(
    const FLidarPointCloudRay& Ray,
    const float& Radius,
    const bool& bVisibleOnly
)

Performs a raycast test against the point cloud. Returns the pointer if hit or nullptr otherwise.

Public function

void

 

RefreshBounds()

Recalculates and updates points bounds.

Public function

void

 

RegisterTraversalOctree

Adds the given traversal octree to the list of linked octrees.

Public function

void

 

ReleaseAllNodes

(
    bool bIncludePersistent
)

Releases all nodes. Optionally, releases persistent nodes too.

Public function

void

 

RemoveCollision()

Removes collision mesh data

Public function

void

 

RemoveFirstPointByRay

(
    const FLidarPointCloudRay& Ray,
    const float& Radius,
    const bool& bVisibleOnly
)

Removes the first point hit by the given ray

Public function

void

 

RemoveHiddenPoints()

Removes all hidden points

Public function

void

 

RemovePoint

(
    FLidarPointCloudPoint Point
)

Attempts to remove the given point.

Public function

void

 

RemovePoint

(
    const FLidarPointCloudPoint* P...
)

Attempts to remove the given point.

Public function

void

 

RemovePoints

(
    TArray64< FLidarPointCloudPoint...
)

Removes points in bulk

Public function

void

 

RemovePoints

(
    TArray< FLidarPointCloudPoint*...
)

Removes points in bulk

Public function

void

 

RemovePointsByRay

(
    const FLidarPointCloudRay& Ray,
    const float& Radius,
    const bool& bVisibleOnly
)

Removes all points hit by the given ray

Public function

void

 

RemovePointsInBox

(
    const FBox& Box,
    const bool& bVisibleOnly
)

Removes all points within the given box

Public function

void

 

RemovePointsInSphere

(
    const FSphere& Sphere,
    const bool& bVisibleOnly
)

Removes all points within the given sphere

Public function

void

 

ResetNormals()

Resets all normals information

Public function

void

 

SetVisibilityOfFirstPointByRay

(
    const bool& bNewVisibility,
    const FLidarPointCloudRay& Ray,
    const float& Radius
)

Sets visibility of the first point hit by the given ray.

Public function

void

 

SetVisibilityOfPointsByRay

(
    const bool& bNewVisibility,
    const FLidarPointCloudRay& Ray,
    const float& Radius
)

Sets visibility of points hit by the given ray.

Public function

void

 

SetVisibilityOfPointsInBox

(
    const bool& bNewVisibility,
    const FBox& Box
)

Sets visibility of points within the given box.

Public function

void

 

SetVisibilityOfPointsInSphere

(
    const bool& bNewVisibility,
    const FSphere& Sphere
)

Sets visibility of points within the given sphere.

Public function

void

 

StreamNodes

(
    TArray< FLidarPointCloudOctreeNode ...,
    const float& CurrentTime
)

Streams requested nodes or extends their lifetime, if already loaded Unloads all unused nodes with expired lifetime

Public function

void

 

UnhideAll()

Marks all points visible

Public function

void

 

UnregisterTraversalOctree

Removes the given traversal octree from the list

Operators

Name Description

Public function

FLidarPointC...

 

operator=

(
    const FLidarPointCloudOctree&
)

Public function

FLidarPointC...

 

operator=

Classes

Name

Description

Public struct

FSharedLODData

Stores shared per-LOD node data.

Constants

Name

Description

MaxBucketSize

Maximum number of unallocated points to keep inside the node before they need to be converted in to a full child node

MaxNodeDepth

Maximum allowed depth for any node

NodeGridResolution

Virtual grid resolution to divide the node into

Deprecated Functions

Name Description

Public function

void

 

GetPointsInFrustum

(
    TArray< FLidarPointCloudPoint*...,
    const FConvexVolume& Frustum,
    const bool& bVisibleOnly
)

Use GetPointsInConvexVolume instead.

Public function

void

 

GetPointsInFrustum

(
    TArray64< FLidarPointCloudPoint...,
    const FConvexVolume& Frustum,
    const bool& bVisibleOnly
)

Use GetPointsInConvexVolume instead.

Public function

void

 

MarkRenderDataInFrustumDirty

(
    const FConvexVolume& Frustum
)

Use MarkRenderDataInConvexVolumeDirty instead.