You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
64 lines
2.0 KiB
C++
64 lines
2.0 KiB
C++
|
|
|
|||
|
|
#include "VisualGraphEdge.h"
|
|||
|
|
#include "VisualGraph.h"
|
|||
|
|
|
|||
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|||
|
|
/// FVisualGraphEdge
|
|||
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|||
|
|
|
|||
|
|
FString FVisualGraphEdge::DumpDot(const FVisualGraph* InGraph, int32 InIndendation) const
|
|||
|
|
{
|
|||
|
|
const FString Indentation = DumpDotIndentation(InIndendation);
|
|||
|
|
const FString ColorContent = DumpDotColor(GetColor());
|
|||
|
|
const FString StyleContent = DumpDotStyle(GetStyle());
|
|||
|
|
|
|||
|
|
static const FString DigraphConnector = TEXT("->");
|
|||
|
|
static const FString GraphConnector = TEXT("--");
|
|||
|
|
const FString& ConnectorContent = (GetDirection() == EVisualGraphEdgeDirection::BothWays) ? GraphConnector : DigraphConnector;
|
|||
|
|
|
|||
|
|
FString SourceNodeName = InGraph->GetNodes()[GetSourceNode()].GetName().ToString();
|
|||
|
|
FString TargetNodeName = InGraph->GetNodes()[GetTargetNode()].GetName().ToString();
|
|||
|
|
|
|||
|
|
if(GetDirection() == EVisualGraphEdgeDirection::SourceToTarget)
|
|||
|
|
{
|
|||
|
|
Swap(SourceNodeName, TargetNodeName);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
FString AttributeContent;
|
|||
|
|
if(DisplayName.IsSet())
|
|||
|
|
{
|
|||
|
|
AttributeContent += FString::Printf(TEXT("label = \"%s\""), *DisplayName.GetValue().ToString());
|
|||
|
|
}
|
|||
|
|
if(Tooltip.IsSet())
|
|||
|
|
{
|
|||
|
|
if(!AttributeContent.IsEmpty())
|
|||
|
|
{
|
|||
|
|
AttributeContent += TEXT(", ");
|
|||
|
|
}
|
|||
|
|
AttributeContent += FString::Printf(TEXT("tooltip = \"%s\""), *Tooltip.GetValue());
|
|||
|
|
}
|
|||
|
|
if(!ColorContent.IsEmpty())
|
|||
|
|
{
|
|||
|
|
if(!AttributeContent.IsEmpty())
|
|||
|
|
{
|
|||
|
|
AttributeContent += TEXT(", ");
|
|||
|
|
}
|
|||
|
|
AttributeContent += FString::Printf(TEXT("color = %s"), *ColorContent);
|
|||
|
|
}
|
|||
|
|
if(!StyleContent.IsEmpty())
|
|||
|
|
{
|
|||
|
|
if(!AttributeContent.IsEmpty())
|
|||
|
|
{
|
|||
|
|
AttributeContent += TEXT(", ");
|
|||
|
|
}
|
|||
|
|
AttributeContent += FString::Printf(TEXT("style = %s"), *StyleContent);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(!AttributeContent.IsEmpty())
|
|||
|
|
{
|
|||
|
|
AttributeContent = FString::Printf(TEXT(" [ %s ]"), *AttributeContent);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return FString::Printf(TEXT("%s%s %s %s%s;\n"),
|
|||
|
|
*Indentation, *SourceNodeName, *ConnectorContent, *TargetNodeName, *AttributeContent);
|
|||
|
|
}
|