// Copyright 2019 yangxiangyun // All Rights Reserved //check list //overridden function change //private module api change #pragma once #include "CoreMinimal.h" #include "EdGraphUtilities.h" #include "ConnectionDrawingPolicy.h" struct InsertNodePinInfo { TWeakPtr InputPin; FVector2D InputPinPosRelToCursor; TWeakPtr OutputPin; FVector2D OutputPinPosRelToCursor; }; #if ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 6 #define FVector2D FVector2f #endif struct InsertableNodePinInfo { float MinPinDist = 100; FConnectionParams Params; UEdGraphPin* InputPin = nullptr; UEdGraphPin* OutputPin = nullptr; FVector2D Pin1Pos; FVector2D Pin1Tangent; FVector2D Pin2Pos; FVector2D Pin2Tangent; FVector2D InputPinPos; FVector2D OutputPinPos; }; struct FNGAGraphPinConnectionFactoryPayLoadData { TWeakPtr HoveredGraphPanel; TWeakPtr HoveredNode; TArray DraggingPins; TWeakPtr OutLazyConnectiblePin; TArray> AutoConnectStartPins; TArray> AutoConnectEndPins; FVector2D NodeBoundMinRelToCursor; FVector2D NodeBoundMaxRelToCursor; TArray InsertNodePinInfos; InsertableNodePinInfo OutInsertableNodePinInfo; TArray OutHoveredInputPins; TArray OutHoveredOutputPins; float CursorDeltaSquared; }; struct NGAGRAPHUTILITY_API FNGAGraphPinConnectionFactory : public FGraphPanelPinConnectionFactory { public: FNGAGraphPinConnectionFactory() { PayLoadData = MakeShareable(new FNGAGraphPinConnectionFactoryPayLoadData()); } virtual FConnectionDrawingPolicy* CreateConnectionPolicy(const class UEdGraphSchema* Schema, int32 InBackLayerID, int32 InFrontLayerID, float ZoomFactor, const class FSlateRect& InClippingRect, class FSlateWindowElementList& InDrawElements, class UEdGraph* InGraphObj) const override; void SetLazyConnectPayloadData(TWeakPtr InHoveredNode, TArray InDraggingPins); void SetAutoConnectPayloadData(TArray> InAutoConnectStartPins, TArray> InAutoConnectEndPins); void ResetLazyConnectPayloadData(); void ResetAutoConnectPayloadData(); void ResetInsertNodePayloadData(); TWeakPtr GetLazyConnectiblePin() { return PayLoadData->OutLazyConnectiblePin; } TSharedPtr PayLoadData; }; #if ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 6 #undef FVector2D #endif