Vuo  2.0.3
VuoCommandConnect.hh
Go to the documentation of this file.
1 
10 #pragma once
11 
12 class VuoEditorWindow;
14 class VuoPort;
15 class VuoRendererCable;
16 class VuoRendererNode;
17 class VuoRendererPort;
18 
23 {
24 public:
25  VuoCommandConnect(VuoRendererCable *cableInProgress,
26  VuoRendererPort *targetPort,
27  VuoRendererCable *displacedCable,
28  VuoRendererPort *portToUnpublish,
29  VuoEditorWindow *window,
30  VuoInputEditorManager *inputEditorManager);
31 
32  int id() const;
33  void undo();
34  void redo();
35 
36 private:
37  static const int commandID;
38  VuoEditorWindow *window;
39  string revertedSnapshot;
40  string updatedSnapshot;
41 
42  // Used only for live-coding updates:
43  set<string> updatedPortIDs;
44 
45  // The following are not and must not be used outside of the constructor and its helper functions:
46  // (@todo: Eliminate as member variables?)
47  VuoRendererCable *cableInProgress;
48  VuoRendererCable *displacedCable;
49  VuoRendererNode *addedNode;
50  VuoPort *fromPortForAddedCable;
51  VuoPort *toPortForAddedCable;
52  bool operationInvolvesGenericPort;
53  VuoInputEditorManager *inputEditorManager;
54  map<VuoRendererCable *, VuoPort *> revertedFromPortForCable;
55  map<VuoRendererCable *, VuoPort *> revertedToPortForCable;
56  map<VuoRendererCable *, VuoPort *> updatedFromPortForCable;
57  map<VuoRendererCable *, VuoPort *> updatedToPortForCable;
58  map<VuoPort *, string> revertedConstantForPort;
59  map<VuoPort *, string> updatedConstantForPort;
60 
61  bool modifiedComponentsIncludeGenericPorts();
62  void inventorySharedValueToBackpropagate();
63 };