| 39 | #include "Engine/NodeGroup.h" |
| 40 | |
| 41 | NATRON_NAMESPACE_ENTER |
| 42 | |
| 43 | void |
| 44 | NodeGuiSerialization::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 | |
| 91 | NATRON_NAMESPACE_EXIT |
nothing calls this directly
no test coverage detected