Kstars

supernovaeitem.cpp
1/*
2 SPDX-FileCopyrightText: 2016 Artem Fedoskin <afedoskin3@gmail.com>
3 SPDX-License-Identifier: GPL-2.0-or-later
4*/
5
6#include "supernovaeitem.h"
7
8#include "kscomet.h"
9#include "labelsitem.h"
10#include "Options.h"
11#include "rootnode.h"
12#include "satellitescomponent.h"
13#include "skylabeler.h"
14#include "supernovaecomponent.h"
15#include "projections/projector.h"
16#include "skynodes/supernovanode.h"
17
19 : SkyItem(LabelsItem::label_t::SATELLITE_LABEL, rootNode), m_snovaComp(snovaComp)
20{
22}
23
25{
26 if (!m_snovaComp->selected())
27 {
28 hide();
29 return;
30 }
31 show();
32
33 QSGNode *n = firstChild();
34
35 while (n != 0)
36 {
37 SupernovaNode *sNode = static_cast<SupernovaNode *>(n);
38 sNode->update();
39
40 n = n->nextSibling();
41 }
42}
43
45{
46 foreach (SkyObject *so, m_snovaComp->objectList())
47 {
48 Supernova *sup = static_cast<Supernova*>(so);
49
50 if (sup)
52 }
53}
This class is in charge of labels in SkyMapLite.
Definition labelsitem.h:53
A QSGClipNode derived class used as a container for holding pointers to nodes and for clipping.
Definition rootnode.h:60
This is an interface for implementing SkyItems that represent SkyComponent derived objects on the Sky...
Definition skyitem.h:30
virtual void hide() override
hides this item and corresponding labels
Definition skyitem.cpp:37
virtual void show() override
makes this node visible
Definition skyitem.cpp:23
Provides all necessary information about an object in the sky: its coordinates, name(s),...
Definition skyobject.h:42
A SkyNode derived class that represents supernova.
virtual void update() override
Update position and visibility of supernova.
Represents the supernova object.
Definition supernova.h:34
This class encapsulates Supernovae.
virtual void update() override
Update positions and visibility of supernovae.
void recreateList()
Recreate the node tree (delete old nodes and append new ones according to SupernovaeItem::objectList(...
SupernovaeItem(SupernovaeComponent *snovaComp, RootNode *rootNode=nullptr)
Constructor.
void appendChildNode(QSGNode *node)
QSGNode * firstChild() const const
QSGNode * nextSibling() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:04:47 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.