Kstars

constellationnamesitem.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 "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};
Represents the constellation names on the sky map.
This class represents ConstellationNamesComponent in SkyMapLite.
ConstellationNamesItem(ConstellationNamesComponent *constComp, RootNode *rootNode=nullptr)
Constructor.
virtual void update()
Update positions ConstellationName labels based on user settings and labels visibility.
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:27
A QSGClipNode derived class used as a container for holding pointers to nodes and for clipping.
Definition rootnode.h:60
This is an interface for implementing SkyItems that represent SkyComponent derived objects on the Sky...
Definition skyitem.h:30
RootNode * rootNode()
Definition skyitem.h:57
Provides all necessary information about an object in the sky: its coordinates, name(s),...
Definition skyobject.h:42
The ConstellationName struct.
void hide()
hides both latin and secondary labels
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 6 2024 12:09:52 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.