Kstars

constellationnamescomponent.h
1/*
2 SPDX-FileCopyrightText: 2005 Thomas Kabelmann <thomas.kabelmann@gmx.de>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "listcomponent.h"
10
11class CultureList;
12class KSNumbers;
13class SkyComposite;
14class SkyPainter;
15
16/**
17 * @class ConstellationNamesComponent
18 * Represents the constellation names on the sky map.
19 *
20 * @author Thomas Kabelmann
21 * @version 0.1
22 */
24{
25 public:
26 /**
27 * @short Constructor
28 * @p parent Pointer to the parent SkyComposite object
29 *
30 * Reads the constellation names data from cnames.dat
31 * Each line in the file is parsed according to column position:
32 * @li 0-1 RA hours [int]
33 * @li 2-3 RA minutes [int]
34 * @li 4-5 RA seconds [int]
35 * @li 6 Dec sign [char; '+' or '-']
36 * @li 7-8 Dec degrees [int]
37 * @li 9-10 Dec minutes [int]
38 * @li 11-12 Dec seconds [int]
39 * @li 13-15 IAU Abbreviation [string] e.g., 'Ori' == Orion
40 * @li 17- Constellation name [string]
41 */
43
44 virtual ~ConstellationNamesComponent() override = default;
45
46 /**
47 * @short Draw constellation names on the sky map.
48 * @p psky Reference to the QPainter on which to paint
49 */
50 void draw(SkyPainter *skyp) override;
51
52 /**
53 * @short we need a custom routine (for now) so we don't
54 * precess the locations of the names.
55 */
56 void update(KSNumbers *num) override;
57
58 /** @short Return true if we are using localized constellation names */
59 inline bool isLocalCNames() { return localCNames; }
60
61 bool selected() override;
62
63 void loadData(CultureList *cultures);
64
65 private:
66 bool localCNames { false };
67};
Represents the constellation names on the sky map.
ConstellationNamesComponent(SkyComposite *parent, CultureList *cultures)
Constructor parent Pointer to the parent SkyComposite object.
bool isLocalCNames()
Return true if we are using localized constellation names.
void update(KSNumbers *num) override
we need a custom routine (for now) so we don't precess the locations of the names.
void draw(SkyPainter *skyp) override
Draw constellation names on the sky map.
A list of all cultures FIXME: Why not use a QStringList?
Definition culturelist.h:17
There are several time-dependent values used in position calculations, that are not specific to an ob...
Definition ksnumbers.h:43
An abstract parent class, to be inherited by SkyComponents that store a QList of SkyObjects.
SkyComposite * parent()
SkyComposite is a kind of container class for SkyComponent objects.
Draws things on the sky, without regard to backend.
Definition skypainter.h:40
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:11:15 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.