Kstars

skynode.cpp
1/*
2 SPDX-FileCopyrightText: 2016 Artem Fedoskin <afedoskin3@gmail.com>
3 SPDX-License-Identifier: GPL-2.0-or-later
4*/
5
6#include "skynode.h"
7
8#include "../skyopacitynode.h"
9
11 : m_opacity(new SkyOpacityNode), m_skyObject(skyObject)
12{
13 appendChildNode(m_opacity);
14}
15
16SkyNode::SkyNode() : m_opacity(new SkyOpacityNode)
17{
18 appendChildNode(m_opacity);
19}
20
22{
23 m_opacity->hide();
24 m_hideCount++;
25}
26
28{
29 m_opacity->show();
30 m_hideCount = 0;
31}
32
33void SkyNode::update(bool drawLabel)
34{
35 m_drawLabel = drawLabel;
36 update();
37}
38
39void SkyNode::addChildNode(QSGNode *node)
40{
41 m_opacity->appendChildNode(node);
42}
43
45{
46 return m_opacity->visible();
47}
virtual void show()
shows all child nodes (sets opacity of m_opacity to 1)
Definition skynode.cpp:27
virtual void hide()
hides all child nodes (sets opacity of m_opacity to 0)
Definition skynode.cpp:21
virtual void update()
Updates coordinate of the object on SkyMapLite.
Definition skynode.h:48
SkyNode(SkyObject *skyObject)
Constructor.
Definition skynode.cpp:10
bool visible()
Definition skynode.cpp:44
Provides all necessary information about an object in the sky: its coordinates, name(s),...
Definition skyobject.h:42
A wrapper for QSGOpacityNode that provides hide() and show() functions.
virtual void show()
makes this node visible
virtual void hide()
hides this node
void appendChildNode(QSGNode *node)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Jul 12 2024 12:00:41 by doxygen 1.11.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.