1 /* 2 SPDX-FileCopyrightText: 2016 Artem Fedoskin <afedoskin3@gmail.com> 3 SPDX-License-Identifier: GPL-2.0-or-later 4 */ 5 #ifndef CROSSHAIRNODE_H_ 6 #define CROSSHAIRNODE_H_ 7 #include "skynode.h" 8 9 /** @class CrossHairNode 10 * 11 * @short Represents crosshair of telescope in SkyMapLite 12 * @version 1.0 13 */ 14 15 class EllipseNode; 16 class LineNode; 17 class LabelNode; 18 class QSGFlatColorMaterial; 19 20 class CrosshairNode : public SkyNode 21 { 22 public: 23 /** 24 * @short Constructor. Initializes lines, ellipses and labels. 25 * @param baseDevice - pointer to telescope 26 * @param rootNode parent RootNode that instantiated this object 27 */ 28 CrosshairNode(INDI::BaseDevice *baseDevice, RootNode *rootNode); 29 30 /** Destructor. **/ 31 ~CrosshairNode(); 32 33 /** @short Update position and visibility of crosshair based on the Alt, Az (or Ra and Dec) 34 of telescope **/ 35 virtual void update() override; 36 virtual void hide() override; 37 38 /** @short Set color of crosshair **/ 39 void setColor(QColor color); 40 41 private: 42 EllipseNode *el1; 43 EllipseNode *el2; 44 45 QSGGeometryNode *lines; 46 QSGFlatColorMaterial *material; 47 48 LabelNode *label; 49 50 LabelsItem *labelsItem; 51 52 INDI::BaseDevice *bd; 53 }; 54 55 #endif 56