Kstars

planetsitem.h
1 /*
2  SPDX-FileCopyrightText: 2016 Artem Fedoskin <[email protected]>
3  SPDX-License-Identifier: GPL-2.0-or-later
4 */
5 
6 #pragma once
7 
8 #include "skyitem.h"
9 
10 class RootNode;
11 class SkyObject;
13 
14 /**
15  * @class PlanetsItem
16  * This class handles planets and their moons in SkyMapLite
17  *
18  * @author Artem Fedoskin
19  * @version 1.0
20  */
21 class PlanetsItem : public SkyItem
22 {
23  public:
24  /**
25  * @short Constructor. Takes lists of pointers to planets(SolarSystemSingleComponent) and their
26  * moons (PlanetMoonsComponent) to instantiate PlanetMoonsNodes for each of the planet.
27  *
28  * @param planets list of pointers to planets
29  * @param moons list of pointers to moons
30  * @param rootNode parent RootNode that instantiates this object
31  */
33  /*QList<PlanetMoonsComponent *> moons,*/ RootNode *rootNode = nullptr);
34 
35  /**
36  * @short returns SolarSystemSingleComponent that corresponds to the planet. Used to determine
37  * whether the planet has to be drawn according to its selected() function
38  * @param planet
39  * @return corresponding SolarSystemSingleComponent
40  */
42 
43  /**
44  * @short calls update() of all child PlanetMoonsNodes
45  * @note see PlanetMoonsNodes::update()
46  */
47  void update() override;
48 
49  /**
50  * @short shows this item and labels for all moons (currently only Jupiter moons. Add here labels
51  * for moons that are needed to be shown)
52  */
53  virtual void show() override;
54 
55  /**
56  * @short hides this item and labels for all moons (currently only Jupiter moons. Add here labels
57  * for moons that are needed to be hidden)
58  */
59  virtual void hide() override;
60 
61  private:
62  QList<SolarSystemSingleComponent *> m_planetComponents;
63  // QList<PlanetMoonsComponent *> m_moonsComponents;
64 };
A base class that is used for displaying SkyComponents on SkyMapLite.
Definition: skyitem.h:29
A container for nodes that holds collection of textures for stars and provides clipping.
Definition: rootnode.h:59
PlanetsItem(QList< SolarSystemSingleComponent * > planets, RootNode *rootNode=nullptr)
Constructor.
Definition: planetsitem.cpp:17
virtual void hide() override
hides this item and labels for all moons (currently only Jupiter moons.
Definition: planetsitem.cpp:70
void update() override
calls update() of all child PlanetMoonsNodes
Definition: planetsitem.cpp:46
SolarSystemSingleComponent * getParentComponent(SkyObject *planet)
returns SolarSystemSingleComponent that corresponds to the planet.
Definition: planetsitem.cpp:36
virtual void show() override
shows this item and labels for all moons (currently only Jupiter moons.
Definition: planetsitem.cpp:64
RootNode * rootNode()
Definition: skyitem.h:57
Information about an object in the sky.
Definition: skyobject.h:41
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Sat Aug 13 2022 04:01:56 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.