Kstars

guidelabelnode.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 #include "../labelsitem.h"
10 
11 #include <QSGSimpleRectNode>
12 
13 class PlanetItemNode;
14 class PointNode;
16 class RootNode;
17 class SkyLabeler;
18 class SkyMapLite;
19 
20 /**
21  * @class GuideLabelNode
22  * Currently this class is not used anywhere.
23  *
24  * @author Artem Fedoskin
25  * @version 1.0
26  */
27 class GuideLabelNode : public SkyNode
28 {
29  public:
30  /**
31  * @short Constructor
32  * @param name name of the guide label
33  * @param type type of the label item
34  */
36 
37  /**
38  * @short changePos changes the position m_point
39  * @param pos new position
40  */
41  virtual void changePos(QPointF pos) override;
42 
43  /**
44  * @short setLabelPos sets the position of label with the given offset from SkyObject's position and
45  * makes the label visible if it was hidden
46  * @param pos position of label
47  * @param angle label angle
48  */
49  void setLabelPos(QPointF pos, float angle);
50 
51  virtual void update() override;
52 
53  inline const QString name() const { return m_name; }
54 
55  QPointF labelPos;
56  qreal left { 0 };
57  qreal right { 0 };
58  qreal top { 0 };
59  qreal bot { 0 };
60 
61  private:
62  QSGSimpleTextureNode *m_textTexture { nullptr };
63  QSize m_textSize { 0, 0 };
64  float m_angle { 0 };
65  QSGSimpleRectNode debugRect;
66  const QString m_name;
67  QPointF m_translatePos;
68 };
virtual void changePos(QPointF pos) override
changePos changes the position m_point
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
virtual void update() override
Updates coordinate of the object on SkyMapLite.
label_t
The label_t enum.
Definition: labelsitem.h:61
Item for displaying sky objects; also handles user interaction events.
Definition: skymaplite.h:58
QSGNode::NodeType type() const const
void setLabelPos(QPointF pos, float angle)
setLabelPos sets the position of label with the given offset from SkyObject's position and makes the ...
GuideLabelNode(QString name, LabelsItem::label_t type)
Constructor.
Provides virtual functions for update of coordinates and nodes hiding.
Definition: skynode.h:27
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Sat Aug 13 2022 04:01:54 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.