File indexing completed on 2024-05-19 07:32:57

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 namespace INDI
0011 {
0012 class BaseDevice;
0013 }
0014 
0015 class ClientManagerLite;
0016 class CrosshairNode;
0017 class RootNode;
0018 class SkyObject;
0019 
0020 /**
0021  * @class TelescopeSymbolsItem
0022  * This class handles representation of telescope symbols in SkyMapLite
0023  *
0024  * @author Artem Fedoskin
0025  * @version 1.0
0026  */
0027 class TelescopeSymbolsItem : public SkyItem
0028 {
0029   public:
0030     /**
0031      * @short Constructor
0032      * @param rootNode parent RootNode that instantiates PlanetsItem
0033      */
0034     explicit TelescopeSymbolsItem(RootNode *rootNode);
0035 
0036     /**
0037      * @short Updates position and visibility of CrosshairNodes that represent telescope symbols
0038      * If client is no more connected to host or device CrosshairNode is deleted.
0039      */
0040     virtual void update() override;
0041 
0042     /** Add telescope symbol for device bd */
0043     void addTelescope(INDI::BaseDevice *bd);
0044 
0045     /** Remove telescope symbol of device bd */
0046     void removeTelescope(INDI::BaseDevice *bd);
0047 
0048   private:
0049     QHash<INDI::BaseDevice *, CrosshairNode *> m_telescopes;
0050     ClientManagerLite *m_clientManager { nullptr };
0051     QColor m_color;
0052     KStarsData *m_KStarsData { nullptr };
0053 };