Vuo
2.3.2
editor
VuoCommandSetCableHidden.cc
Go to the documentation of this file.
1
10
#include "
VuoCommandCommon.hh
"
11
#include "
VuoCommandSetCableHidden.hh
"
12
#include "
VuoCompilerNode.hh
"
13
#include "
VuoEditorComposition.hh
"
14
#include "
VuoEditorWindow.hh
"
15
#include "
VuoRendererCable.hh
"
16
20
VuoCommandSetCableHidden::VuoCommandSetCableHidden
(
VuoRendererCable
*cable,
bool
hidden,
VuoEditorWindow
*window)
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);
30
cable->
getBase
()->
getFromPort
()->
getRenderer
()->
updateGeometry
();
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
48
int
VuoCommandSetCableHidden::id
()
const
49
{
50
return
VuoCommandCommon::setCableHiddenCommandID
;
51
}
52
56
void
VuoCommandSetCableHidden::redo
()
57
{
58
VuoCommandCommon_redo
;
59
60
window->
resetCompositionWithSnapshot
(updatedSnapshot);
61
}
62
66
void
VuoCommandSetCableHidden::undo
()
67
{
68
VuoCommandCommon_undo
;
69
70
window->
resetCompositionWithSnapshot
(revertedSnapshot);
71
}
Generated on Sat Jun 19 2021 10:17:42 for Vuo by
1.9.1