Kstars

solarsystemsinglecomponent.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 <QColor>
10 
11 /**
12  *@class SolarSystemSingleComponent
13  *This class encapsulates some methods which are shared between
14  *all single-object solar system components (Sun, Moon, Planet, Pluto)
15  *
16  *@author Thomas Kabelmann
17  *@version 0.1
18  */
19 
20 #include "skycomponent.h"
21 
23 class KSNumbers;
24 class KSPlanet;
25 class KSPlanetBase;
26 class SkyLabeler;
27 
29 {
30  public:
31  /** Initialize visible method, minimum size and sizeScale. */
32  SolarSystemSingleComponent(SolarSystemComposite *, KSPlanetBase *kspb, bool (*visibleMethod)(), bool isMoon = false);
33 
34  ~SolarSystemSingleComponent() override;
35 
36  /** Return pointer to stored planet object. */
38  {
39  return m_Planet;
40  }
41 
42  bool selected() override;
43 
44  /**
45  * @brief update Only convert Equatorial to Horizontal coordinates given current time.
46  * @param num pointer to KSNumbers instance for target time
47  */
48  void update(KSNumbers *num) override;
49 
50  /**
51  * @brief updateSolarSystemBodies Update Equatorial & Horizontal coordinates.
52  * @param num pointer to KSNumbers instance for target time
53  */
54  void updateSolarSystemBodies(KSNumbers *num) override;
55 
56  /**
57  * @brief update Update Equatorial & Horizontal coordinates. (Called more frequently.)
58  */
59  void updateMoons(KSNumbers *num) override;
60 
61 
62  SkyObject *findByName(const QString &name, bool exact = true) override;
63  SkyObject *objectNearest(SkyPoint *p, double &maxrad) override;
64  void draw(SkyPainter *skyp) override;
65 
66  protected:
67  void drawTrails(SkyPainter *skyp) override;
68 
69  private:
70  bool (*visible)();
71  bool m_isMoon { false };
72  QColor m_Color;
73  KSPlanet *m_Earth;
74  KSPlanetBase *m_Planet;
75 };
void update(KSNumbers *num) override
update Only convert Equatorial to Horizontal coordinates given current time.
void updateSolarSystemBodies(KSNumbers *num) override
updateSolarSystemBodies Update Equatorial & Horizontal coordinates.
Stores dms coordinates for a point in the sky. for converting between coordinate systems.
Definition: skypoint.h:44
KSPlanetBase * planet()
Return pointer to stored planet object.
SolarSystemSingleComponent(SolarSystemComposite *, KSPlanetBase *kspb, bool(*visibleMethod)(), bool isMoon=false)
Initialize visible method, minimum size and sizeScale.
Store several time-dependent astronomical quantities.
Definition: ksnumbers.h:42
void drawTrails(SkyPainter *skyp) override
Draw trails for objects.
SkyObject * objectNearest(SkyPoint *p, double &maxrad) override
Find the SkyObject nearest the given SkyPoint.
Draws things on the sky, without regard to backend.
Definition: skypainter.h:39
void draw(SkyPainter *skyp) override
Draw the object on the SkyMap skyp a pointer to the SkyPainter to use.
Provides necessary information about objects in the solar system.
Definition: ksplanet.h:32
SkyObject * findByName(const QString &name, bool exact=true) override
Search the children of this SkyComponent for a SkyObject whose name matches the argument name the nam...
void updateMoons(KSNumbers *num) override
update Update Equatorial & Horizontal coordinates.
Information about an object in the sky.
Definition: skyobject.h:41
Provides necessary information about objects in the solar system.
Definition: ksplanetbase.h:49
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Fri Sep 22 2023 03:57:59 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.