Files
UnrealEngineUWP/Engine/Source/Developer/RigVMDeveloper/Public/RigVMModel/RigVMLink.h
Helge Mathee d45bd63bb7 Control Rig: Replace cast link with cast nodes
#rb sara.schvartzman
#jira na
#preflight https://horde.devtools.epicgames.com/job/636503dfde2c4dbb5d92f669

[CL 23008884 by Helge Mathee in ue5-main branch]
2022-11-07 04:27:49 -05:00

86 lines
2.3 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "UObject/ObjectMacros.h"
#include "RigVMPin.h"
#include "RigVMLink.generated.h"
class URigVMGraph;
/**
* The Link represents a connection between two Pins
* within a Graph. The Link can be accessed on the
* Graph itself - or through the URigVMPin::GetLinks()
* method.
*/
UCLASS(BlueprintType)
class RIGVMDEVELOPER_API URigVMLink : public UObject
{
GENERATED_BODY()
public:
// Default constructor
URigVMLink()
{
SourcePin = TargetPin = nullptr;
}
// Serialization override
virtual void Serialize(FArchive& Ar) override;
// Returns the current index of this Link within its owning Graph.
UFUNCTION(BlueprintCallable, Category = RigVMLink)
int32 GetLinkIndex() const;
// Returns the Link's owning Graph/
UFUNCTION(BlueprintCallable, Category = RigVMLink)
URigVMGraph* GetGraph() const;
// Returns the source Pin of this Link (or nullptr)
UFUNCTION(BlueprintCallable, Category = RigVMLink)
URigVMPin* GetSourcePin() const;
// Returns the target Pin of this Link (or nullptr)
UFUNCTION(BlueprintCallable, Category = RigVMLink)
URigVMPin* GetTargetPin() const;
// Returns the opposite Pin of this Link given one of its edges (or nullptr)
UFUNCTION(BlueprintCallable, Category = RigVMLink)
URigVMPin* GetOppositePin(const URigVMPin* InPin) const;
// Returns a string representation of the Link,
// for example: "NodeA.Color.R -> NodeB.Translation.X"
// note: can be split again using SplitPinPathRepresentation
UFUNCTION(BlueprintCallable, Category = RigVMLink)
FString GetPinPathRepresentation();
// Returns a string representation of the Link given the two pin paths
// for example: "NodeA.Color.R -> NodeB.Translation.X"
// note: can be split again using SplitPinPathRepresentation
static FString GetPinPathRepresentation(const FString& InSourcePinPath, const FString& InTargetPinPath);
// Splits a pin path represenation of a link
// for example: "NodeA.Color.R -> NodeB.Translation.X"
// into its two pin paths
static bool SplitPinPathRepresentation(const FString& InString, FString& OutSource, FString& OutTarget);
private:
void PrepareForCopy();
UPROPERTY()
FString SourcePinPath;
UPROPERTY()
FString TargetPinPath;
mutable URigVMPin* SourcePin;
mutable URigVMPin* TargetPin;
friend class URigVMController;
};