Kstars

satellitenode.h
1 /*
2  SPDX-FileCopyrightText: 2016 Artem Fedoskin <[email protected]>
3  SPDX-License-Identifier: GPL-2.0-or-later
4 */
5 
6 #pragma once
7 
8 #include "skynode.h"
9 
10 class PolyNode;
11 class Satellite;
12 class PointNode;
14 class LabelNode;
15 
16 /**
17  * @class SatelliteNode
18  *
19  * @short A SkyNode derived class that represents satellite
20  * @author Artem Fedoskin
21  * @version 1.0
22  */
23 
24 class SatelliteNode : public SkyNode
25 {
26  public:
27  /**
28  * @short Constructor.
29  * @param sat - satellite that is represented by this node
30  * @param rootNode - pointer to the top parent node
31  */
32  SatelliteNode(Satellite *sat, RootNode *rootNode);
33 
34  /**
35  * @short Update position and visibility of satellite.
36  * We also check user settings (Options::drawSatellitesLikeStars()) and based on that draw satellite
37  * either like star or with lines
38  */
39  virtual void update() override;
40  virtual void hide() override;
41 
42  /**
43  * @short Initialize m_lines (if not already) to draw satellite with lines
44  */
45  void initLines();
46 
47  /**
48  * @short Initialize m_point (if not already) to draw satellite as a star
49  */
50  void initPoint();
51 
52  virtual void changePos(QPointF pos) override;
53 
54  inline Satellite *sat() { return m_sat; }
55 
56  private:
57  Satellite *m_sat;
58  RootNode *m_rootNode;
59 
60  QSGGeometryNode *m_lines { nullptr };
61 
62  LabelNode *m_label { nullptr };
63 
64  QSGFlatColorMaterial *m_material { nullptr };
65  QSGGeometry *m_geometry { nullptr };
66 
67  PointNode *m_point { nullptr };
68 };
SkyOpacityNode derived class that represents stars and planets using cached QSGTexture.
Definition: pointnode.h:24
A container for nodes that holds collection of textures for stars and provides clipping.
Definition: rootnode.h:59
void initPoint()
Initialize m_point (if not already) to draw satellite as a star.
A SkyNode derived class used for displaying labels.
Definition: labelnode.h:26
SatelliteNode(Satellite *sat, RootNode *rootNode)
Constructor.
virtual void hide() override
hides all child nodes (sets opacity of m_opacity to 0)
A SkyNode derived class that represents satellite.
Definition: satellitenode.h:24
virtual void changePos(QPointF pos) override
changes the position of SkyNode on SkyMapLite.
A SkyOpacityNode derived class used for drawing of polygons (both filled and non-filled)
Definition: polynode.h:22
Provides virtual functions for update of coordinates and nodes hiding.
Definition: skynode.h:27
void initLines()
Initialize m_lines (if not already) to draw satellite with lines.
virtual void update() override
Update position and visibility of satellite.
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Thu Aug 11 2022 04:00:04 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.