Vuo  2.0.3
VuoCommandChangeNode.hh
Go to the documentation of this file.
1 
10 #pragma once
11 
12 #include "VuoCommandCommon.hh"
13 
14 class VuoCable;
17 class VuoEditorWindow;
18 class VuoPort;
19 class VuoRendererNode;
20 
25 {
26 public:
28 
29  int id() const;
30  void undo();
31  void redo();
32 
33 private:
34  static const int commandID;
35  VuoEditorWindow *window;
36  VuoEditorComposition *composition;
37  string revertedSnapshot;
38  string updatedSnapshot;
39 
41  bool operationInvolvesGenericPort;
42 
43  VuoRendererNode *oldNode;
44  VuoRendererNode *newNode;
45  map<VuoPort *, VuoPort *> updatedPortForOriginalPort;
46 
47  set<VuoCable *> incomingCables;
48  set<VuoCable *> outgoingCables;
49  vector<VuoRendererNode *> collapsedTypecasts;
50  map<VuoRendererNode *, set<VuoCable *> > incomingCablesForTypecast;
51  map<VuoRendererNode *, VuoPort *> hostPortForTypecast;
52  vector<pair<VuoPort *, VuoPublishedPort *> > revertedPublishedInternalExternalPortCombinations;
53  vector<pair<VuoPort *, VuoPublishedPort *> > updatedPublishedInternalExternalPortCombinations;
54  map<VuoRendererNode *, vector<pair<VuoPort *, VuoPublishedPort *> > > publishedInternalExternalPortCombinationsForTypecast;
55  map<pair<VuoPort *, VuoPublishedPort *>, bool> publishedConnectionCarriedData;
56  map<VuoCable *, VuoPort *> originalFromPortForCable;
57  map<VuoCable *, VuoPort *> originalToPortForCable;
58  map<VuoCable *, bool> cableCarriedData;
59  map<VuoPort *, string> constantValueForOriginalPort;
60 
61  void createAllMappings();
62  void createAllPortMappings();
63  void createSwappedNodePortMappings();
64  void removeStrandedAttachments();
65  void swapNodes();
66  void createNecessaryAttachments();
67 };