Kstars

constellationnamescomponent.h
1 /*
2  SPDX-FileCopyrightText: 2005 Thomas Kabelmann <[email protected]>
3 
4  SPDX-License-Identifier: GPL-2.0-or-later
5 */
6 
7 #pragma once
8 
9 #include "listcomponent.h"
10 
11 class CultureList;
12 class KSNumbers;
13 class SkyComposite;
14 class 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 };
SkyComposite * parent()
Definition: skycomponent.h:137
bool isLocalCNames()
Return true if we are using localized constellation names.
Store several time-dependent astronomical quantities.
Definition: ksnumbers.h:42
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.
Draws things on the sky, without regard to backend.
Definition: skypainter.h:39
ConstellationNamesComponent(SkyComposite *parent, CultureList *cultures)
Constructor parent Pointer to the parent SkyComposite object.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Tue Nov 28 2023 03:58:17 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.