File indexing completed on 2024-04-28 03:44:24
0001 /* 0002 SPDX-FileCopyrightText: 2016 Artem Fedoskin <afedoskin3@gmail.com> 0003 SPDX-License-Identifier: GPL-2.0-or-later 0004 */ 0005 #ifndef CROSSHAIRNODE_H_ 0006 #define CROSSHAIRNODE_H_ 0007 #include "skynode.h" 0008 0009 /** @class CrossHairNode 0010 * 0011 * @short Represents crosshair of telescope in SkyMapLite 0012 * @version 1.0 0013 */ 0014 0015 class EllipseNode; 0016 class LineNode; 0017 class LabelNode; 0018 class QSGFlatColorMaterial; 0019 0020 class CrosshairNode : public SkyNode 0021 { 0022 public: 0023 /** 0024 * @short Constructor. Initializes lines, ellipses and labels. 0025 * @param baseDevice - pointer to telescope 0026 * @param rootNode parent RootNode that instantiated this object 0027 */ 0028 CrosshairNode(INDI::BaseDevice *baseDevice, RootNode *rootNode); 0029 0030 /** Destructor. **/ 0031 ~CrosshairNode(); 0032 0033 /** @short Update position and visibility of crosshair based on the Alt, Az (or Ra and Dec) 0034 of telescope **/ 0035 virtual void update() override; 0036 virtual void hide() override; 0037 0038 /** @short Set color of crosshair **/ 0039 void setColor(QColor color); 0040 0041 private: 0042 EllipseNode *el1; 0043 EllipseNode *el2; 0044 0045 QSGGeometryNode *lines; 0046 QSGFlatColorMaterial *material; 0047 0048 LabelNode *label; 0049 0050 LabelsItem *labelsItem; 0051 0052 INDI::BaseDevice *bd; 0053 }; 0054 0055 #endif