75 lines
1.9 KiB
C++
75 lines
1.9 KiB
C++
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "UObject/NoExportTypes.h"
|
|
#include "FLESHGraph.generated.h"
|
|
|
|
class UFLESHGraphNode;
|
|
|
|
/**
|
|
* FLESH graph class
|
|
* Manages nodes in the FLESH editor
|
|
*/
|
|
UCLASS(BlueprintType)
|
|
class FLESHEDITOR_API UFLESHGraph : public UObject
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
public:
|
|
// Constructor
|
|
UFLESHGraph();
|
|
|
|
// Initialize graph
|
|
UFUNCTION(BlueprintCallable, Category = "FLESH")
|
|
void Initialize();
|
|
|
|
// Add node
|
|
UFUNCTION(BlueprintCallable, Category = "FLESH")
|
|
UFLESHGraphNode* AddNode(TSubclassOf<UFLESHGraphNode> NodeClass, const FVector2D& Position);
|
|
|
|
// Remove node
|
|
UFUNCTION(BlueprintCallable, Category = "FLESH")
|
|
bool RemoveNode(UFLESHGraphNode* Node);
|
|
|
|
// Connect nodes
|
|
UFUNCTION(BlueprintCallable, Category = "FLESH")
|
|
bool ConnectNodes(UFLESHGraphNode* SourceNode, UFLESHGraphNode* TargetNode);
|
|
|
|
// Disconnect nodes
|
|
UFUNCTION(BlueprintCallable, Category = "FLESH")
|
|
bool DisconnectNodes(UFLESHGraphNode* SourceNode, UFLESHGraphNode* TargetNode);
|
|
|
|
// Get all nodes
|
|
UFUNCTION(BlueprintCallable, Category = "FLESH")
|
|
TArray<UFLESHGraphNode*> GetAllNodes() const;
|
|
|
|
// Get root node
|
|
UFUNCTION(BlueprintCallable, Category = "FLESH")
|
|
UFLESHGraphNode* GetRootNode() const;
|
|
|
|
// Set root node
|
|
UFUNCTION(BlueprintCallable, Category = "FLESH")
|
|
void SetRootNode(UFLESHGraphNode* InRootNode);
|
|
|
|
// Clear graph
|
|
UFUNCTION(BlueprintCallable, Category = "FLESH")
|
|
void ClearGraph();
|
|
|
|
// Save graph
|
|
UFUNCTION(BlueprintCallable, Category = "FLESH")
|
|
bool SaveGraph();
|
|
|
|
// Load graph
|
|
UFUNCTION(BlueprintCallable, Category = "FLESH")
|
|
bool LoadGraph();
|
|
|
|
private:
|
|
// All nodes in the graph
|
|
UPROPERTY()
|
|
TArray<TObjectPtr<UFLESHGraphNode>> Nodes;
|
|
|
|
// Root node
|
|
UPROPERTY()
|
|
TObjectPtr<UFLESHGraphNode> RootNode;
|
|
};
|