Vuo
2.4.4
Loading...
Searching...
No Matches
renderer
VuoRendererReadOnlyDictionary.cc
Go to the documentation of this file.
1
10
#include "
VuoRendererReadOnlyDictionary.hh
"
11
#include "
VuoNodeClass.hh
"
12
#include "
VuoPort.hh
"
13
#include "
VuoStringUtilities.hh
"
14
18
VuoRendererReadOnlyDictionary::VuoRendererReadOnlyDictionary
(
VuoNode
*baseNode,
VuoRendererSignaler
*signaler)
19
:
VuoRendererHiddenInputAttachment
(baseNode, signaler)
20
{
21
}
22
27
bool
VuoRendererReadOnlyDictionary::isReadOnlyDictionary
(
VuoNode
*baseNode)
28
{
29
const
string
makeDictionaryNodeClassNamePrefix =
"vuo.dictionary.make."
;
30
if
(!
VuoStringUtilities::beginsWith
(baseNode->
getNodeClass
()->
getClassName
(), makeDictionaryNodeClassNamePrefix))
31
return
false
;
32
33
VuoPort
*hostPort =
getUnderlyingHostPortForNode
(baseNode);
34
VuoNode
*hostNode =
getUnderlyingHostNodeForNode
(baseNode);
35
bool
isInputToCalculateNode = ((hostPort &&
36
(hostPort->
getClass
()->
getName
() ==
"values"
) &&
37
VuoStringUtilities::beginsWith
(hostNode->
getNodeClass
()->
getClassName
(),
"vuo.math.calculate"
)));
38
return
isInputToCalculateNode;
39
}
40
44
VuoNode
* VuoRendererReadOnlyDictionary::getValueListNode()
45
{
46
VuoPort
*valueListInputPort =
getBase
()->
getInputPortWithName
(
"values"
);
47
if
(!valueListInputPort)
48
return
NULL;
49
50
VuoNode
*makeValueListNode =
getListNodeConnectedToInputPort
(valueListInputPort);
51
return
makeValueListNode;
52
}
53
57
VuoNode
* VuoRendererReadOnlyDictionary::getKeyListNode()
58
{
59
VuoPort
*valueListInputPort =
getBase
()->
getInputPortWithName
(
"keys"
);
60
return
getListNodeConnectedToInputPort
(valueListInputPort);
61
}
62
67
set<VuoNode *>
VuoRendererReadOnlyDictionary::getCoattachments
(
void
)
68
{
69
VuoNode
*keyListNode = getKeyListNode();
70
VuoNode
*valueListNode = getValueListNode();
71
72
set<VuoNode *> coattachments;
73
if
(keyListNode)
74
coattachments.insert(keyListNode);
75
if
(valueListNode)
76
coattachments.insert(valueListNode);
77
return
coattachments;
78
}
Generated on Thu Nov 9 2023 16:59:30 for Vuo by
1.9.8