File indexing completed on 2024-04-21 03:44:17

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 ConstellationArtComponent;
0012 
0013 /**
0014  * @class ConstellationArtItem
0015  * This class handles constellation art in SkyMapLite. Each constellation image is represented by ConstellationArtNode.
0016  * @see ConstellationArtNode
0017  *
0018  * @author Artem Fedoskin
0019  * @version 1.0
0020  */
0021 
0022 class ConstellationArtItem : public SkyItem
0023 {
0024   public:
0025     /**
0026      * @param artComp - pointer to ConstellationArtComponent instance, that handles constellation art data
0027      * @param rootNode - pointer to the root node
0028      */
0029     explicit ConstellationArtItem(ConstellationArtComponent *artComp, RootNode *rootNode = nullptr);
0030 
0031     /**
0032      * @short calls update() of all child ConstellationArtNodes if constellation art is on. Otherwise
0033      * calls deleteNodes().
0034      */
0035     void update() override;
0036 
0037     /**
0038      * @short deleteNodes deletes constellation art data and ConstellationArtNodes
0039      * @see ConstellationArtComponent::deleteData()
0040      */
0041     void deleteNodes();
0042 
0043     /**
0044      * @short loadNodes loads constellation art data and creates ConstellationArtNodes
0045      * @see ConstellationArtComponent::loadData()
0046      */
0047     void loadNodes();
0048 
0049   private:
0050     ConstellationArtComponent *m_artComp { nullptr };
0051 };