22template<
class Po
intSetType>
50 ForceInitializeAllNodes();
76 ++CurrentSeedTimestamp;
80 check(SeedPointExternalIDMap.Contains(
SeedPoint.ExternalID) ==
false);
81 int32 NewIndex = SeedPoints.Num();
82 SeedPointExternalIDMap.Add(
SeedPoint.ExternalID, NewIndex);
88 FGraphNode* Node = GetNodeForPointSetID(PointID);
89 Node->GraphDistance =
SeedPoint.StartDistance;
90 Node->FrozenTimestamp = CurrentSeedTimestamp;
91 Node->SeedID = NewIndex;
92 Queue.
Insert(PointID,
float(Node->GraphDistance));
100 FGraphNode* Node = GetNodeForPointSetID(NextID);
101 check(Node !=
nullptr);
103 Node->FrozenTimestamp = CurrentSeedTimestamp;
104 UpdateNeighboursSparse(Node);
113 const FGraphNode* Node = GetNodeForPointSetID(PointID);
114 if (Node ==
nullptr || Node->FrozenTimestamp == InvalidFrozenTimestamp)
131 for (
int32 PointID = 0; PointID <
MaxID; PointID++)
152 const FGraphNode* Node = GetNodeForPointSetID(PointID);
153 return (Node !=
nullptr && Node->FrozenTimestamp != InvalidFrozenTimestamp);
162 const FGraphNode* Node = GetNodeForPointSetID(PointID);
163 return (Node !=
nullptr && Node->FrozenTimestamp != InvalidFrozenTimestamp) ? Node->GraphDistance :
InvalidDistance();
175 const FGraphNode*
CurNode = GetNodeForPointSetID(PointID);
176 if (
CurNode ==
nullptr ||
CurNode->FrozenTimestamp == InvalidFrozenTimestamp)
187 if (
CurNode->ParentPointID == -1)
195 if (
CurNode ==
nullptr ||
CurNode->FrozenTimestamp == InvalidFrozenTimestamp)
212 double GraphDistance;
213 int32 FrozenTimestamp;
220 FIndexPriorityQueue Queue;
225 const int32 InvalidFrozenTimestamp = -1;
226 int32 CurrentSeedTimestamp = 0;
229 void ForceInitializeAllNodes()
235 FGraphNode NewNode{ k, -1, -1,
InvalidDistance(), InvalidFrozenTimestamp };
236 AllocatedNodes[k] = NewNode;
255 void UpdateNeighboursSparse(FGraphNode*
Parent)
263 if (
NbrNode->FrozenTimestamp == CurrentSeedTimestamp)
#define check(expr)
Definition AssertionMacros.h:314
#define ensure( InExpression)
Definition AssertionMacros.h:464
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
UE::Math::TVector< double > FVector3d
Definition MathFwd.h:60
void SetNum(SizeType NewNum, EAllowShrinking AllowShrinking=UE::Core::Private::AllowShrinkingByDefault< AllocatorType >())
Definition Array.h:2308
Definition UnrealString.h.inl:34
Definition FunctionFwd.h:19
bool Contains(int NodeID) const
Definition IndexPriorityQueue.h:106
int GetCount() const
Definition IndexPriorityQueue.h:88
void Insert(int NodeID, float priority)
Definition IndexPriorityQueue.h:121
void Initialize(int MaxNodeID)
Definition IndexPriorityQueue.h:67
int Dequeue()
Definition IndexPriorityQueue.h:142
Definition IncrementalMeshDijkstra.h:24
double GetDistance(int32 PointID) const
Definition IncrementalMeshDijkstra.h:160
int32 GetSeedExternalIDForPointSetID(int32 PointID)
Definition IncrementalMeshDijkstra.h:111
static double InvalidDistance()
Definition IncrementalMeshDijkstra.h:53
TIncrementalMeshDijkstra(const PointSetType *PointSetIn)
Definition IncrementalMeshDijkstra.h:41
bool HasDistance(int32 PointID) const
Definition IncrementalMeshDijkstra.h:150
const PointSetType * PointSet
Definition IncrementalMeshDijkstra.h:27
bool FindPathToNearestSeed(int32 PointID, TArray< int32 > &PathToSeedOut, int32 MaxLength=100000)
Definition IncrementalMeshDijkstra.h:173
void AddSeedPoints(const TArray< FSeedPoint > &SeedPointsIn)
Definition IncrementalMeshDijkstra.h:74
TUniqueFunction< FVector3d(int32)> GetPositionFunc
Definition IncrementalMeshDijkstra.h:34
int32 FindMaxGraphDistancePointID() const
Definition IncrementalMeshDijkstra.h:126
Definition AdvancedWidgetsModule.cpp:13
Definition NumericLimits.h:41
Definition IncrementalMeshDijkstra.h:59
int32 PointID
Definition IncrementalMeshDijkstra.h:63
int32 ExternalID
Definition IncrementalMeshDijkstra.h:61
double StartDistance
Definition IncrementalMeshDijkstra.h:65