Files
UnrealEngine/Engine/Source/Editor/AIGraph/Public/AIGraphEditor.h
2025-05-18 13:04:45 +08:00

61 lines
1.6 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "EditorUndoClient.h"
#include "GraphEditor.h"
class AIGRAPH_API FAIGraphEditor : public FEditorUndoClient
{
public:
FAIGraphEditor();
virtual ~FAIGraphEditor();
FGraphPanelSelectionSet GetSelectedNodes() const;
virtual void OnSelectedNodesChanged(const TSet<class UObject*>& NewSelection);
//~ Begin FEditorUndoClient Interface
virtual void PostUndo(bool bSuccess) override;
virtual void PostRedo(bool bSuccess) override;
// End of FEditorUndoClient
void CreateCommandList();
// Delegates for graph editor commands
void SelectAllNodes();
bool CanSelectAllNodes() const;
void DeleteSelectedNodes();
bool CanDeleteNodes() const;
void DeleteSelectedDuplicatableNodes();
void CutSelectedNodes();
bool CanCutNodes() const;
void CopySelectedNodes();
bool CanCopyNodes() const;
void PasteNodes();
void PasteNodesHere(const FVector2D& Location);
bool CanPasteNodes() const;
void DuplicateNodes();
bool CanDuplicateNodes() const;
bool CanCreateComment() const;
void OnCreateComment();
virtual void OnClassListUpdated();
protected:
virtual void FixupPastedNodes(const TSet<UEdGraphNode*>& NewPastedGraphNodes, const TMap<FGuid/*New*/, FGuid/*Old*/>& NewToOldNodeMapping);
protected:
/** Currently focused graph */
TWeakPtr<SGraphEditor> UpdateGraphEdPtr;
/** The command list for this editor */
TSharedPtr<FUICommandList> GraphEditorCommands;
/** Handle to the registered OnClassListUpdated delegate */
FDelegateHandle OnClassListUpdatedDelegateHandle;
};