Files
UnrealEngineUWP/Engine/Source/Editor/GraphEditor/Public/GraphSplineOverlapResult.h
Ryan Vance 7c51ff94af Merging //UE4/Dev-Main to Dev-VR (//UE4/Dev-VR)
CL 1 of 8
#rb integration

[CL 4748712 by Ryan Vance in Dev-VR branch]
2019-01-17 18:54:05 -05:00

72 lines
1.6 KiB
C++

// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "SGraphPin.h"
/////////////////////////////////////////////////////
// FGraphSplineOverlapResult
struct GRAPHEDITOR_API FGraphSplineOverlapResult
{
public:
FGraphSplineOverlapResult()
: Pin1Handle(nullptr)
, Pin2Handle(nullptr)
, BestPinHandle(nullptr)
, Pin1(nullptr)
, Pin2(nullptr)
, DistanceSquared(FLT_MAX)
, DistanceSquaredToPin1(FLT_MAX)
, DistanceSquaredToPin2(FLT_MAX)
{
}
FGraphSplineOverlapResult(UEdGraphPin* InPin1, UEdGraphPin* InPin2, float InDistanceSquared, float InDistanceSquaredToPin1, float InDistanceSquaredToPin2)
: Pin1Handle(InPin1)
, Pin2Handle(InPin2)
, BestPinHandle(nullptr)
, Pin1(InPin1)
, Pin2(InPin2)
, DistanceSquared(InDistanceSquared)
, DistanceSquaredToPin1(InDistanceSquaredToPin1)
, DistanceSquaredToPin2(InDistanceSquaredToPin2)
{
}
bool IsValid() const
{
return DistanceSquared < FLT_MAX;
}
void ComputeBestPin();
float GetDistanceSquared() const
{
return DistanceSquared;
}
TSharedPtr<class SGraphPin> GetBestPinWidget(const class SGraphPanel& InGraphPanel) const
{
TSharedPtr<class SGraphPin> Result;
if (IsValid())
{
Result = BestPinHandle.FindInGraphPanel(InGraphPanel);
}
return Result;
}
bool GetPins(const class SGraphPanel& InGraphPanel, UEdGraphPin*& OutPin1, UEdGraphPin*& OutPin2) const;
protected:
FGraphPinHandle Pin1Handle;
FGraphPinHandle Pin2Handle;
FGraphPinHandle BestPinHandle;
UEdGraphPin* Pin1;
UEdGraphPin* Pin2;
float DistanceSquared;
float DistanceSquaredToPin1;
float DistanceSquaredToPin2;
};