Kstars

solarsystemsinglecomponent.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 <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
23class KSNumbers;
24class KSPlanet;
25class KSPlanetBase;
26class SkyLabeler;
27
29{
30 public:
31 /** Initialize visible method, minimum size and sizeScale. */
32 SolarSystemSingleComponent(SolarSystemComposite *, KSPlanetBase *kspb, bool (*visibleMethod)(), bool isMoon = false);
33
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};
There are several time-dependent values used in position calculations, that are not specific to an ob...
Definition ksnumbers.h:43
A subclass of TrailObject that provides additional information needed for most solar system objects.
A subclass of KSPlanetBase for seven of the major planets in the solar system (Earth and Pluto have t...
Definition ksplanet.h:33
SkyComponent represents an object on the sky map.
The purpose of this class is to prevent labels from overlapping.
Definition skylabeler.h:99
Provides all necessary information about an object in the sky: its coordinates, name(s),...
Definition skyobject.h:42
Draws things on the sky, without regard to backend.
Definition skypainter.h:40
The sky coordinates of a point in the sky.
Definition skypoint.h:45
The solar system composite manages all planets, asteroids and comets.
This class encapsulates some methods which are shared between all single-object solar system componen...
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...
SkyObject * objectNearest(SkyPoint *p, double &maxrad) override
Find the SkyObject nearest the given SkyPoint.
KSPlanetBase * planet()
Return pointer to stored planet object.
SolarSystemSingleComponent(SolarSystemComposite *, KSPlanetBase *kspb, bool(*visibleMethod)(), bool isMoon=false)
Initialize visible method, minimum size and sizeScale.
void updateMoons(KSNumbers *num) override
update Update Equatorial & Horizontal coordinates.
void updateSolarSystemBodies(KSNumbers *num) override
updateSolarSystemBodies Update Equatorial & Horizontal coordinates.
void drawTrails(SkyPainter *skyp) override
Draw trails for objects.
void draw(SkyPainter *skyp) override
Draw the object on the SkyMap skyp a pointer to the SkyPainter to use.
void update(KSNumbers *num) override
update Only convert Equatorial to Horizontal coordinates given current time.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:04:47 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.