Olympe Engine 2.0
2D Game Engine with ECS Architecture
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
Olympe::AI::AIEditorClipboard Class Reference

Singleton clipboard manager for AI Editor. More...

#include <AIEditorClipboard.h>

Public Member Functions

void Copy (const std::vector< NodeGraph::NodeId > &nodeIds, NodeGraph::GraphDocument *doc)
 Copy selected nodes to clipboard.
 
void Cut (const std::vector< NodeGraph::NodeId > &nodeIds, NodeGraph::GraphDocument *doc)
 Cut selected nodes (copy + delete)
 
std::vector< NodeGraph::NodeIdPaste (NodeGraph::GraphDocument *doc, Vector pasteOffset)
 Paste clipboard nodes into active graph.
 
bool IsEmpty () const
 Check if clipboard has data.
 
void Clear ()
 Clear clipboard.
 
size_t GetNodeCount () const
 Get number of nodes in clipboard.
 

Static Public Member Functions

static AIEditorClipboardGet ()
 Get singleton instance.
 

Private Member Functions

 AIEditorClipboard ()=default
 
 ~AIEditorClipboard ()=default
 
 AIEditorClipboard (const AIEditorClipboard &)=delete
 
AIEditorClipboardoperator= (const AIEditorClipboard &)=delete
 

Private Attributes

std::vector< ClipboardNodem_nodes
 Copied nodes.
 
std::vector< ClipboardLinkm_links
 Copied links.
 

Detailed Description

Singleton clipboard manager for AI Editor.

Provides Cut/Copy/Paste functionality for nodes in the AI Editor. Preserves node connections and maintains relative positions when pasting.

Definition at line 60 of file AIEditorClipboard.h.

Constructor & Destructor Documentation

◆ AIEditorClipboard() [1/2]

Olympe::AI::AIEditorClipboard::AIEditorClipboard ( )
privatedefault

◆ ~AIEditorClipboard()

Olympe::AI::AIEditorClipboard::~AIEditorClipboard ( )
privatedefault

◆ AIEditorClipboard() [2/2]

Olympe::AI::AIEditorClipboard::AIEditorClipboard ( const AIEditorClipboard )
privatedelete

Member Function Documentation

◆ Clear()

void Olympe::AI::AIEditorClipboard::Clear ( )

Clear clipboard.

Definition at line 206 of file AIEditorClipboard.cpp.

References m_links, and m_nodes.

Referenced by Copy().

+ Here is the caller graph for this function:

◆ Copy()

void Olympe::AI::AIEditorClipboard::Copy ( const std::vector< NodeGraph::NodeId > &  nodeIds,
NodeGraph::GraphDocument doc 
)

◆ Cut()

void Olympe::AI::AIEditorClipboard::Cut ( const std::vector< NodeGraph::NodeId > &  nodeIds,
NodeGraph::GraphDocument doc 
)

Cut selected nodes (copy + delete)

Parameters
nodeIdsList of selected node IDs
docSource graph document

Definition at line 116 of file AIEditorClipboard.cpp.

References Copy(), GetComponentTypeID_Static(), and SYSTEM_LOG.

Referenced by Olympe::AI::AIEditorGUI::MenuAction_Cut(), and Test12_ClipboardCut().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Get()

AIEditorClipboard & Olympe::AI::AIEditorClipboard::Get ( )
static

Get singleton instance.

Returns
Reference to the clipboard instance

Definition at line 20 of file AIEditorClipboard.cpp.

References GetComponentTypeID_Static().

Referenced by Olympe::AI::AIEditorGUI::MenuAction_Copy(), Olympe::AI::AIEditorGUI::MenuAction_Cut(), Olympe::AI::AIEditorGUI::MenuAction_Paste(), Test11_ClipboardCopyPaste(), Test12_ClipboardCut(), and Test13_ClipboardLinkPreservation().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetNodeCount()

size_t Olympe::AI::AIEditorClipboard::GetNodeCount ( ) const
inline

Get number of nodes in clipboard.

Returns
Number of nodes

Definition at line 105 of file AIEditorClipboard.h.

References m_nodes.

Referenced by Test11_ClipboardCopyPaste().

+ Here is the caller graph for this function:

◆ IsEmpty()

bool Olympe::AI::AIEditorClipboard::IsEmpty ( ) const

Check if clipboard has data.

Returns
true if clipboard contains nodes

Definition at line 201 of file AIEditorClipboard.cpp.

References m_nodes.

Referenced by Paste(), Test11_ClipboardCopyPaste(), and Test12_ClipboardCut().

+ Here is the caller graph for this function:

◆ operator=()

AIEditorClipboard & Olympe::AI::AIEditorClipboard::operator= ( const AIEditorClipboard )
privatedelete

◆ Paste()

std::vector< NodeGraph::NodeId > Olympe::AI::AIEditorClipboard::Paste ( NodeGraph::GraphDocument doc,
Vector  pasteOffset 
)

Paste clipboard nodes into active graph.

Parameters
docTarget graph document
pasteOffsetOffset from original position
Returns
List of new node IDs

Definition at line 139 of file AIEditorClipboard.cpp.

References GetComponentTypeID_Static(), IsEmpty(), m_links, m_nodes, Olympe::NodeGraph::NodeData::name, Olympe::AI::PIN_ID_INPUT_OFFSET, Olympe::AI::PIN_ID_MULTIPLIER, Olympe::AI::PIN_ID_OUTPUT_OFFSET, SYSTEM_LOG, and Olympe::NodeGraph::PinId::value.

Referenced by Olympe::AI::AIEditorGUI::MenuAction_Paste(), Test11_ClipboardCopyPaste(), Test12_ClipboardCut(), and Test13_ClipboardLinkPreservation().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_links

std::vector<ClipboardLink> Olympe::AI::AIEditorClipboard::m_links
private

Copied links.

Definition at line 116 of file AIEditorClipboard.h.

Referenced by Clear(), Copy(), and Paste().

◆ m_nodes

std::vector<ClipboardNode> Olympe::AI::AIEditorClipboard::m_nodes
private

Copied nodes.

Definition at line 115 of file AIEditorClipboard.h.

Referenced by Clear(), Copy(), GetNodeCount(), IsEmpty(), and Paste().


The documentation for this class was generated from the following files: