Navigation
API > API/Runtime > API/Runtime/GeometryCore
TMeshDijkstra computes graph distances on a mesh from seed point(s) using Dijkstra's algorithm.
Templated on the point set type, which must provide positions, normals, and neighbours. Currently will only work for FDynamicMesh3 and FDynamicPointSet3 because of call to PointSetType->VtxVerticesItr()
| Name | TMeshDijkstra |
| Type | class |
| Header File | /Engine/Source/Runtime/GeometryCore/Public/Parameterization/MeshDijkstra.h |
| Include Path | #include "Parameterization/MeshDijkstra.h" |
Syntax
template<class PointSetType>
class TMeshDijkstra
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
TMeshDijkstra
(
const PointSetType* PointSetIn |
Construct TMeshDijkstra for the given PointSet. | Parameterization/MeshDijkstra.h |
Structs
| Name | Remarks |
|---|---|
| FGraphNode | Information about each active/computed point |
| FSeedPoint | FSeedPoint defines a seed point passed to the various compute methods below |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bEnableDistanceWeighting | bool | If enabled, when computing local point-pair distances, GetWeightedDistanceFunc() will be called with the Euclidean distance to allow for alternative metrics | Parameterization/MeshDijkstra.h | |
| GetPositionFunc | TUniqueFunction< FVector3d(int32)> | Return the 3D Position of a given Point in the PointSet. | Parameterization/MeshDijkstra.h | |
| GetWeightedDistanceFunc | TUniqueFunction< double(int32 FromVID, int32 ToVID, int32 SeedVID, double EuclideanDistance)> | Called when computing pairwise point distances between neighbours FromVID and ToVID, to allow for alternative distance metrics. | Parameterization/MeshDijkstra.h | |
| PointSet | const PointSetType * | PointSet we are calculating on | Parameterization/MeshDijkstra.h |
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| AllocatedNodes | TDynamicVector< FGraphNode > | Parameterization/MeshDijkstra.h | ||
| IDToNodeIndexMap | TMap< int32, int32 > | To avoid constructing FGraphNode for all input points (because we are computing a "local" param), we only allocate on demand, and then store a sparse mapping in IDToNodeIndexMap | Parameterization/MeshDijkstra.h | |
| MaxGraphDistance | double | Max distances encountered during last compute | Parameterization/MeshDijkstra.h | |
| MaxGraphDistancePointID | int32 | Parameterization/MeshDijkstra.h | ||
| Queue | FIndexPriorityQueue | Queue of nodes to process (for dijkstra front propagation) | Parameterization/MeshDijkstra.h | |
| SeedPoints | TArray< FSeedPoint > | Parameterization/MeshDijkstra.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void ComputeToMaxDistance
(
const TArray< FSeedPoint >& SeedPointsIn, |
Computes graph distances outwards from seed points to all points that are less/equal to ComputeToMaxDistance from the seed. | Parameterization/MeshDijkstra.h | |
void ComputeToMaxDistance
(
const TArray< FVector2d >& SeedPointsIn, |
Computes graph distances outwards from seed points to all points that are less/equal to ComputeToMaxDistance from the seed. | Parameterization/MeshDijkstra.h | |
bool ComputeToTargetPoint
(
const TArray< FSeedPoint >& SeedPointsIn, |
Computes graph distances outwards from seed points to all points that are less/equal to ComputeToMaxDistance from the seed, or until TargetPointID is reached. | Parameterization/MeshDijkstra.h | |
bool FindPathToNearestSeed
(
int32 PointID, |
Find path from a point to the nearest seed point | Parameterization/MeshDijkstra.h | |
double GetDistance
(
int32 PointID |
Parameterization/MeshDijkstra.h | ||
double GetMaxGraphDistance() |
Parameterization/MeshDijkstra.h | ||
int32 GetMaxGraphDistancePointID() |
Parameterization/MeshDijkstra.h | ||
int32 GetSeedExternalIDForPointSetID
(
int32 PointID |
Parameterization/MeshDijkstra.h | ||
bool HasDistance
(
int32 PointID |
Parameterization/MeshDijkstra.h | ||
void Reset() |
Reset internal data structures but keep allocated memory | Parameterization/MeshDijkstra.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static double InvalidDistance() |
Parameterization/MeshDijkstra.h |