File indexing completed on 2024-03-24 03:47:02

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 
0013 /**
0014  * @class AsteroidsItem
0015  * This class handles asteroids in SkyMapLite
0016  *
0017  * @author Artem Fedoskin
0018  * @version 1.0
0019  */
0020 class AsteroidsItem : public SkyItem
0021 {
0022   public:
0023     /**
0024      * @short Constructor
0025      * @param asteroidsList const reference to list of asteroids
0026      * @param rootNode parent RootNode that instantiates PlanetsItem
0027      */
0028     explicit AsteroidsItem(const QList<SkyObject *> &asteroidsList, RootNode *rootNode = nullptr);
0029 
0030     /**
0031      * @short recreates the node tree (deletes old nodes and appends new ones based on SkyObjects in
0032      * m_asteroidsList)
0033      */
0034     void recreateList();
0035 
0036     /** Determines the visibility of the object and its label and hides/updates them accordingly */
0037     virtual void update() override;
0038 
0039   private:
0040     const QList<SkyObject *> &m_asteroidsList;
0041 };