File indexing completed on 2024-03-24 15:17:27
0001 /* 0002 SPDX-FileCopyrightText: 2016 Artem Fedoskin <afedoskin3@gmail.com> 0003 SPDX-License-Identifier: GPL-2.0-or-later 0004 */ 0005 0006 #pragma once 0007 0008 #include "skyitem.h" 0009 0010 class RootNode; 0011 class SkyObject; 0012 class SolarSystemSingleComponent; 0013 0014 /** 0015 * @class PlanetsItem 0016 * This class handles planets and their moons in SkyMapLite 0017 * 0018 * @author Artem Fedoskin 0019 * @version 1.0 0020 */ 0021 class PlanetsItem : public SkyItem 0022 { 0023 public: 0024 /** 0025 * @short Constructor. Takes lists of pointers to planets(SolarSystemSingleComponent) and their 0026 * moons (PlanetMoonsComponent) to instantiate PlanetMoonsNodes for each of the planet. 0027 * 0028 * @param planets list of pointers to planets 0029 * @param moons list of pointers to moons 0030 * @param rootNode parent RootNode that instantiates this object 0031 */ 0032 explicit PlanetsItem(QList<SolarSystemSingleComponent *> planets, 0033 /*QList<PlanetMoonsComponent *> moons,*/ RootNode *rootNode = nullptr); 0034 0035 /** 0036 * @short returns SolarSystemSingleComponent that corresponds to the planet. Used to determine 0037 * whether the planet has to be drawn according to its selected() function 0038 * @param planet 0039 * @return corresponding SolarSystemSingleComponent 0040 */ 0041 SolarSystemSingleComponent *getParentComponent(SkyObject *planet); 0042 0043 /** 0044 * @short calls update() of all child PlanetMoonsNodes 0045 * @note see PlanetMoonsNodes::update() 0046 */ 0047 void update() override; 0048 0049 /** 0050 * @short shows this item and labels for all moons (currently only Jupiter moons. Add here labels 0051 * for moons that are needed to be shown) 0052 */ 0053 virtual void show() override; 0054 0055 /** 0056 * @short hides this item and labels for all moons (currently only Jupiter moons. Add here labels 0057 * for moons that are needed to be hidden) 0058 */ 0059 virtual void hide() override; 0060 0061 private: 0062 QList<SolarSystemSingleComponent *> m_planetComponents; 0063 // QList<PlanetMoonsComponent *> m_moonsComponents; 0064 };