MCPcopy Create free account
hub / github.com/NatronGitHub/Natron / initialize

Method initialize

Gui/NodeGuiSerialization.cpp:41–89  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39#include "Engine/NodeGroup.h"
40
41NATRON_NAMESPACE_ENTER
42
43void
44NodeGuiSerialization::initialize(const NodeGui* n)
45{
46 ////All this code is MT-safe
47 NodePtr node = n->getNode();
48
49
50 _nodeName = node->getFullyQualifiedName();
51 QPointF pos = n->getPos_mt_safe();
52 _posX = pos.x();
53 _posY = pos.y();
54 n->getSize(&_width, &_height);
55 _previewEnabled = node->isPreviewEnabled();
56 QColor color = n->getCurrentColor();
57 _r = color.redF();
58 _g = color.greenF();
59 _b = color.blueF();
60 _selected = n->isSelected();
61
62 _hasOverlayColor = n->getOverlayColor(&_overlayR, &_overlayG, &_overlayB);
63
64 NodeGroup* isGrp = node->isEffectGroup();
65 if (isGrp) {
66 NodesList nodes;
67 isGrp->getActiveNodes(&nodes);
68
69 _children.clear();
70
71 for (NodesList::iterator it = nodes.begin(); it != nodes.end(); ++it) {
72
73 if (!(*it)->isPartOfProject()) {
74 continue;
75 }
76 NodeGuiIPtr gui_i = (*it)->getNodeGui();
77 if (!gui_i) {
78 continue;
79 }
80 NodeGui* childGui = dynamic_cast<NodeGui*>( gui_i.get() );
81 if (!childGui) {
82 continue;
83 }
84 NodeGuiSerializationPtr state( new NodeGuiSerialization() );
85 state->initialize(childGui);
86 _children.push_back(state);
87 }
88 }
89}
90
91NATRON_NAMESPACE_EXIT

Callers

nothing calls this directly

Calls 15

getPos_mt_safeMethod · 0.80
isSelectedMethod · 0.80
getActiveNodesMethod · 0.80
isPartOfProjectMethod · 0.80
getNodeMethod · 0.45
getFullyQualifiedNameMethod · 0.45
xMethod · 0.45
yMethod · 0.45
getSizeMethod · 0.45
getCurrentColorMethod · 0.45
getOverlayColorMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected