1 | // Copyright (C) 2019 Ford Motor Company |
---|---|
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
3 | |
4 | #include "subtreeenabler_p.h" |
5 | #include <Qt3DRender/private/qsubtreeenabler_p.h> |
6 | |
7 | QT_BEGIN_NAMESPACE |
8 | |
9 | namespace Qt3DRender { |
10 | |
11 | namespace Render { |
12 | |
13 | SubtreeEnabler::SubtreeEnabler() |
14 | : FrameGraphNode(FrameGraphNode::SubtreeEnabler, FrameGraphNode::ReadWrite) |
15 | { |
16 | } |
17 | |
18 | void SubtreeEnabler::syncFromFrontEnd(const Qt3DCore::QNode *frontEnd, bool firstTime) |
19 | { |
20 | const QSubtreeEnabler *node = qobject_cast<const QSubtreeEnabler *>(object: frontEnd); |
21 | if (!node) |
22 | return; |
23 | |
24 | FrameGraphNode::syncFromFrontEnd(frontEnd, firstTime); |
25 | |
26 | const auto enablement = node->enablement(); |
27 | if (enablement != m_enablement) { |
28 | m_enablement = enablement; |
29 | markDirty(changes: AbstractRenderer::FrameGraphDirty); |
30 | } |
31 | } |
32 | |
33 | } //Render |
34 | |
35 | } //Qt3DRender |
36 | |
37 | QT_END_NAMESPACE |
38 |