Kstars

constellationnamesitem.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 "skyitem.h"
9 
10 #include <QSGOpacityNode>
11 
13 
14 /**
15  * @short The ConstellationName struct. It holds SkyObject (with coordinates of label) and 2 labels
16  * (latin and secondary names)
17  */
19 {
20  explicit ConstellationName(SkyObject *skyObj);
21 
22  SkyObject *obj { nullptr };
23  LabelNode *latin { nullptr };
24  LabelNode *secondary { nullptr };
25 
26  /** @short hides both latin and secondary labels */
27  void hide();
28 };
29 
30 /**
31  * @class ConstellationNamesItem
32  *
33  * This class represents ConstellationNamesComponent in SkyMapLite.
34  *
35  * @author Artem Fedoskin
36  * @version 1.0
37  */
39 {
40  public:
41  /**
42  * Constructor.
43  * @param constComp a pointer to ConstellationNamesComponent that this object has to represent in
44  * SkyMapLite
45  * @param rootNode a pointer to SkyItem's parent node
46  */
48 
49  /**
50  * Update positions ConstellationName labels based on user settings and labels visibility.
51  * If the user chose latin names then label with secondary name won't be created until
52  * settings are not changed.
53  *
54  * @short updates positions of labels based on their visibility and user settings.
55  */
56  virtual void update();
57 
58  /** @short Delete all labels and recreate m_names according to object list of m_constelNamesComp */
59  void recreateList();
60 
61  private:
62  ConstellationNamesComponent *m_constelNamesComp { nullptr };
64 };
ConstellationNamesItem(ConstellationNamesComponent *constComp, RootNode *rootNode=nullptr)
Constructor.
A base class that is used for displaying SkyComponents on SkyMapLite.
Definition: skyitem.h:29
A container for nodes that holds collection of textures for stars and provides clipping.
Definition: rootnode.h:59
void recreateList()
Delete all labels and recreate m_names according to object list of m_constelNamesComp.
A SkyNode derived class used for displaying labels.
Definition: labelnode.h:26
The ConstellationName struct.
void hide()
hides both latin and secondary labels
virtual void update()
Update positions ConstellationName labels based on user settings and labels visibility.
RootNode * rootNode()
Definition: skyitem.h:57
Information about an object in the sky.
Definition: skyobject.h:41
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Thu Aug 11 2022 03:59:57 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.