Vuo  2.3.2
VuoCommandSetCableHidden.cc
Go to the documentation of this file.
1 
10 #include "VuoCommandCommon.hh"
12 #include "VuoCompilerNode.hh"
13 #include "VuoEditorComposition.hh"
14 #include "VuoEditorWindow.hh"
15 #include "VuoRendererCable.hh"
16 
21  : VuoCommandCommon(window)
22 {
23  setText(QApplication::translate("VuoEditorWindow", "Hide"));
24  this->window = window;
25  this->revertedSnapshot = window->getComposition()->takeSnapshot();
26 
27  // Start of command content.
28  {
29  cable->setWireless(hidden);
31  cable->getBase()->getToPort()->getRenderer()->updateGeometry();
32  }
33  // End of command content.
34 
35  this->updatedSnapshot = window->getComposition()->takeSnapshot();
36 
37  setDescription("%s cable %s:%s -> %s:%s",
38  hidden ? "Hide" : "Unhide",
39  cable->getBase()->getFromNode()->hasCompiler() ? cable->getBase()->getFromNode()->getCompiler()->getIdentifier().c_str() : "?",
40  cable->getBase()->getFromPort()->getClass()->getName().c_str(),
41  cable->getBase()->getToNode()->hasCompiler() ? cable->getBase()->getToNode()->getCompiler()->getIdentifier().c_str() : "?",
42  cable->getBase()->getToPort()->getClass()->getName().c_str());
43 }
44 
49 {
51 }
52 
57 {
59 
60  window->resetCompositionWithSnapshot(updatedSnapshot);
61 }
62 
67 {
69 
70  window->resetCompositionWithSnapshot(revertedSnapshot);
71 }