Plasma Engine  2.0
Loading...
Searching...
No Matches
NodeCommands.h
1#pragma once
2
3#include <ToolsFoundation/Command/Command.h>
4
7class plPin;
8
9class PL_TOOLSFOUNDATION_DLL plRemoveNodeCommand : public plCommand
10{
11 PL_ADD_DYNAMIC_REFLECTION(plRemoveNodeCommand, plCommand);
12
13public:
15
16public: // Properties
17 plUuid m_Object;
18
19private:
20 virtual plStatus DoInternal(bool bRedo) override;
21 virtual plStatus UndoInternal(bool bFireEvents) override;
22 virtual void CleanupInternal(CommandState state) override;
23
24private:
25 plDocumentObject* m_pObject = nullptr;
26};
27
28
29class PL_TOOLSFOUNDATION_DLL plMoveNodeCommand : public plCommand
30{
31 PL_ADD_DYNAMIC_REFLECTION(plMoveNodeCommand, plCommand);
32
33public:
35
36public: // Properties
37 plUuid m_Object;
38 plVec2 m_NewPos = plVec2::MakeZero();
39
40private:
41 virtual plStatus DoInternal(bool bRedo) override;
42 virtual plStatus UndoInternal(bool bFireEvents) override;
43 virtual void CleanupInternal(CommandState state) override {}
44
45private:
46 plDocumentObject* m_pObject = nullptr;
47 plVec2 m_vOldPos = plVec2::MakeZero();
48};
49
50
51class PL_TOOLSFOUNDATION_DLL plConnectNodePinsCommand : public plCommand
52{
53 PL_ADD_DYNAMIC_REFLECTION(plConnectNodePinsCommand, plCommand);
54
55public:
57
58public: // Properties
59 plUuid m_ConnectionObject;
60 plUuid m_ObjectSource;
61 plUuid m_ObjectTarget;
62 plString m_sSourcePin;
63 plString m_sTargetPin;
64
65private:
66 virtual plStatus DoInternal(bool bRedo) override;
67 virtual plStatus UndoInternal(bool bFireEvents) override;
68 virtual void CleanupInternal(CommandState state) override {}
69
70private:
71 plDocumentObject* m_pConnectionObject = nullptr;
72 plDocumentObject* m_pObjectSource = nullptr;
73 plDocumentObject* m_pObjectTarget = nullptr;
74};
75
76
77class PL_TOOLSFOUNDATION_DLL plDisconnectNodePinsCommand : public plCommand
78{
79 PL_ADD_DYNAMIC_REFLECTION(plDisconnectNodePinsCommand, plCommand);
80
81public:
83
84public: // Properties
85 plUuid m_ConnectionObject;
86
87private:
88 virtual plStatus DoInternal(bool bRedo) override;
89 virtual plStatus UndoInternal(bool bFireEvents) override;
90 virtual void CleanupInternal(CommandState state) override {}
91
92private:
93 plDocumentObject* m_pConnectionObject = nullptr;
94 const plDocumentObject* m_pObjectSource = nullptr;
95 const plDocumentObject* m_pObjectTarget = nullptr;
96 plString m_sSourcePin;
97 plString m_sTargetPin;
98};
99
100
101class PL_TOOLSFOUNDATION_DLL plNodeCommands
102{
103public:
104 static plStatus AddAndConnectCommand(plCommandHistory* pHistory, const plRTTI* pConnectionType, const plPin& sourcePin, const plPin& targetPin);
105 static plStatus DisconnectAndRemoveCommand(plCommandHistory* pHistory, const plUuid& connectionObject);
106};
Stores the undo / redo stacks of transactions done on a document.
Definition CommandHistory.h:52
Interface for a command.
Definition Command.h:15
Definition NodeCommands.h:52
Definition NodeCommands.h:78
Definition DocumentObjectBase.h:11
Definition NodeCommands.h:30
Definition NodeCommands.h:102
Definition DocumentNodeManager.h:59
This class holds information about reflected types. Each instance represents one type that is known t...
Definition RTTI.h:30
Definition NodeCommands.h:10
This data type is the abstraction for 128-bit Uuid (also known as GUID) instances.
Definition Uuid.h:11
static constexpr plVec2Template< float > MakeZero()
Definition Vec2.h:49
An plResult with an additional message for the reason of failure.
Definition Status.h:12