Kstars

supernovaeitem.cpp
1 /*
2  SPDX-FileCopyrightText: 2016 Artem Fedoskin <[email protected]>
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 {
21  recreateList();
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 }
A base class that is used for displaying SkyComponents on SkyMapLite.
Definition: skyitem.h:29
virtual void update() override
Update positions and visibility of supernovae.
A container for nodes that holds collection of textures for stars and provides clipping.
Definition: rootnode.h:59
void recreateList()
Recreate the node tree (delete old nodes and append new ones according to SupernovaeItem::objectList(...
void appendChildNode(QSGNode *node)
QSGNode * firstChild() const const
Handles labels in SkyMapLite.
Definition: labelsitem.h:52
virtual void show() override
makes this node visible
Definition: skyitem.cpp:23
SupernovaeItem(SupernovaeComponent *snovaComp, RootNode *rootNode=nullptr)
Constructor.
virtual void hide() override
hides this item and corresponding labels
Definition: skyitem.cpp:37
This class encapsulates Supernovae.
QSGNode * nextSibling() const const
virtual void update() override
Update position and visibility of supernova.
Information about an object in the sky.
Definition: skyobject.h:41
A SkyNode derived class that represents supernova.
Definition: supernovanode.h:22
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Sat Aug 13 2022 04:02:00 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.