Kstars

satellitenode.h
1/*
2 SPDX-FileCopyrightText: 2016 Artem Fedoskin <afedoskin3@gmail.com>
3 SPDX-License-Identifier: GPL-2.0-or-later
4*/
5
6#pragma once
7
8#include "skynode.h"
9
10class PolyNode;
11class Satellite;
12class PointNode;
14class 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
24class 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};
A SkyNode derived class used for displaying labels.
Definition labelnode.h:27
SkyOpacityNode derived class that represents stars and planets using cached QSGTexture.
Definition pointnode.h:25
A SkyOpacityNode derived class used for drawing of polygons (both filled and non-filled)
Definition polynode.h:23
A QSGClipNode derived class used as a container for holding pointers to nodes and for clipping.
Definition rootnode.h:60
A SkyNode derived class that represents satellite.
virtual void changePos(QPointF pos) override
changes the position of SkyNode on SkyMapLite.
void initLines()
Initialize m_lines (if not already) to draw satellite with lines.
virtual void hide() override
hides all child nodes (sets opacity of m_opacity to 0)
SatelliteNode(Satellite *sat, RootNode *rootNode)
Constructor.
void initPoint()
Initialize m_point (if not already) to draw satellite as a star.
virtual void update() override
Update position and visibility of satellite.
Represents an artificial satellites.
Definition satellite.h:23
Provides virtual functions for update of coordinates and nodes hiding.
Definition skynode.h:28
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:38:43 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.