2014-12-07 19:09:38 -05:00
|
|
|
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
2014-11-14 18:23:41 -05:00
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "ConnectionDrawingPolicy.h"
|
|
|
|
|
|
|
|
|
|
/////////////////////////////////////////////////////
|
|
|
|
|
// FStateMachineConnectionDrawingPolicy
|
|
|
|
|
|
|
|
|
|
// This class draws the connections for an UEdGraph with a state machine schema
|
|
|
|
|
class FStateMachineConnectionDrawingPolicy : public FConnectionDrawingPolicy
|
|
|
|
|
{
|
|
|
|
|
protected:
|
|
|
|
|
UEdGraph* GraphObj;
|
|
|
|
|
|
|
|
|
|
TMap<UEdGraphNode*, int32> NodeWidgetMap;
|
|
|
|
|
public:
|
|
|
|
|
//
|
|
|
|
|
FStateMachineConnectionDrawingPolicy(int32 InBackLayerID, int32 InFrontLayerID, float ZoomFactor, const FSlateRect& InClippingRect, FSlateWindowElementList& InDrawElements, UEdGraph* InGraphObj);
|
|
|
|
|
|
|
|
|
|
// FConnectionDrawingPolicy interface
|
2015-01-10 00:31:36 -05:00
|
|
|
virtual void DetermineWiringStyle(UEdGraphPin* OutputPin, UEdGraphPin* InputPin, /*inout*/ FConnectionParams& Params) override;
|
2014-11-14 18:23:41 -05:00
|
|
|
virtual void Draw(TMap<TSharedRef<SWidget>, FArrangedWidget>& PinGeometries, FArrangedChildren& ArrangedNodes) override;
|
|
|
|
|
virtual void DetermineLinkGeometry(
|
|
|
|
|
FArrangedChildren& ArrangedNodes,
|
|
|
|
|
TSharedRef<SWidget>& OutputPinWidget,
|
|
|
|
|
UEdGraphPin* OutputPin,
|
|
|
|
|
UEdGraphPin* InputPin,
|
|
|
|
|
/*out*/ FArrangedWidget*& StartWidgetGeometry,
|
|
|
|
|
/*out*/ FArrangedWidget*& EndWidgetGeometry
|
|
|
|
|
) override;
|
2015-01-10 00:31:36 -05:00
|
|
|
virtual void DrawSplineWithArrow(const FGeometry& StartGeom, const FGeometry& EndGeom, const FConnectionParams& Params) override;
|
|
|
|
|
virtual void DrawSplineWithArrow(const FVector2D& StartPoint, const FVector2D& EndPoint, const FConnectionParams& Params) override;
|
2014-11-14 18:23:41 -05:00
|
|
|
virtual void DrawPreviewConnector(const FGeometry& PinGeometry, const FVector2D& StartPoint, const FVector2D& EndPoint, UEdGraphPin* Pin) override;
|
2015-01-10 00:31:36 -05:00
|
|
|
virtual FVector2D ComputeSplineTangent(const FVector2D& Start, const FVector2D& End) const override;
|
2014-11-14 18:23:41 -05:00
|
|
|
// End of FConnectionDrawingPolicy interface
|
|
|
|
|
|
|
|
|
|
protected:
|
2015-01-10 00:31:36 -05:00
|
|
|
void Internal_DrawLineWithArrow(const FVector2D& StartAnchorPoint, const FVector2D& EndAnchorPoint, const FConnectionParams& Params);
|
2014-11-14 18:23:41 -05:00
|
|
|
};
|