Vuo
2.2.1
base
VuoCable.cc
Go to the documentation of this file.
1
10
#include "
VuoCable.hh
"
11
#include "
VuoPublishedPort.hh
"
12
16
VuoCable::VuoCable
(
VuoNode
* fromNode,
VuoPort
* fromPort,
VuoNode
* toNode,
VuoPort
* toPort,
bool
addCableToPorts)
17
:
VuoBase
<
VuoCompilerCable
,
VuoRendererCable
>(
"VuoCable"
)
18
{
19
this->fromNode = fromNode;
20
this->fromPort = fromPort;
21
this->toNode = toNode;
22
this->toPort = toPort;
23
24
if
(addCableToPorts)
25
{
26
if
(fromPort)
27
fromPort->
addConnectedCable
(
this
);
28
29
if
(toPort)
30
toPort->
addConnectedCable
(
this
);
31
}
32
}
33
37
VuoNode
*
VuoCable::getFromNode
(
void
)
38
{
39
return
fromNode;
40
}
41
45
VuoPort
*
VuoCable::getFromPort
(
void
)
46
{
47
return
fromPort;
48
}
49
53
VuoNode
*
VuoCable::getToNode
(
void
)
54
{
55
return
toNode;
56
}
57
61
VuoPort
*
VuoCable::getToPort
(
void
)
62
{
63
return
toPort;
64
}
65
71
void
VuoCable::setFrom
(
VuoNode
*fromNode,
VuoPort
*fromPort)
72
{
73
if
(this->fromPort)
74
{
75
this->fromPort->
removeConnectedCable
(
this
);
76
}
77
78
if
(fromPort)
79
{
80
fromPort->
addConnectedCable
(
this
);
81
}
82
83
this->fromPort = fromPort;
84
this->fromNode = fromNode;
85
}
86
92
void
VuoCable::setTo
(
VuoNode
*toNode,
VuoPort
*toPort)
93
{
94
if
(this->toPort)
95
{
96
this->toPort->
removeConnectedCable
(
this
);
97
}
98
99
if
(toPort)
100
{
101
toPort->
addConnectedCable
(
this
);
102
}
103
104
this->toPort = toPort;
105
this->toNode = toNode;
106
}
107
111
bool
VuoCable::isPublished
(
void
)
112
{
113
return
(
isPublishedInputCable
() ||
isPublishedOutputCable
());
114
}
115
119
bool
VuoCable::isPublishedInputCable
(
void
)
120
{
121
return
dynamic_cast<
VuoPublishedPort
*
>
(fromPort);
122
}
123
127
bool
VuoCable::isPublishedOutputCable
(
void
)
128
{
129
return
dynamic_cast<
VuoPublishedPort
*
>
(toPort);
130
}
Generated on Wed Dec 30 2020 12:21:24 for Vuo by
1.8.20