Kstars

planetmoonscomponent.h
1/*
2 SPDX-FileCopyrightText: Vipul Kumar Singh <vipulkrsingh@gmail.com>
3 SPDX-FileCopyrightText: Médéric Boquien <mboquien@free.fr>
4
5 SPDX-License-Identifier: GPL-2.0-or-later
6*/
7
8#pragma once
9
10#include "skycomponent.h"
11#include "skyobjects/ksplanetbase.h"
12
13#include <memory>
14
15class KSNumbers;
16class PlanetMoons;
17class SkyComposite;
19
20/**
21 * @class PlanetMoonsComponent
22 * Represents the planetmoons on the sky map.
23 *
24 * @author Vipul Kumar Singh
25 * @author Médéric boquien
26 * @version 0.1
27 */
29{
30 public:
31 /**
32 * @short Constructor
33 *
34 * @p parent pointer to the parent SkyComposite
35 */
37
38 virtual ~PlanetMoonsComponent() override = default;
39
40 bool selected() override;
41 void draw(SkyPainter *skyp) override;
42#ifndef KSTARS_LITE
43 void update(KSNumbers *num) override;
44#endif
45 void updateMoons(KSNumbers *num) override;
46
47 SkyObject *objectNearest(SkyPoint *p, double &maxrad) override;
48
49 /**
50 * @return a pointer to a moon if its name matches the argument
51 *
52 * @p name the name to be matched
53 * @return a SkyObject pointer to the moon whose name matches
54 * the argument, or a nullptr pointer if no match was found.
55 */
56 SkyObject *findByName(const QString &name, bool exact = true) override;
57
58 /** Return pointer to stored planet object. */
60
61 /** Return pointer to stored moons object. */
62 inline PlanetMoons *getMoons() const
63 {
64 return pmoons.get();
65 }
66
67 protected:
68 void drawTrails(SkyPainter *skyp) override;
69
70 private:
71 KSPlanetBase::Planets planet;
72 std::unique_ptr<PlanetMoons> pmoons;
73 SolarSystemSingleComponent *m_Planet { nullptr };
74};
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.
Represents the planetmoons on the sky map.
SkyObject * objectNearest(SkyPoint *p, double &maxrad) override
Find the SkyObject nearest the given SkyPoint.
PlanetMoonsComponent(SkyComposite *parent, SolarSystemSingleComponent *pla, KSPlanetBase::Planets &planet)
Constructor.
void update(KSNumbers *num) override
Update the sky position(s) of this component.
PlanetMoons * getMoons() const
Return pointer to stored moons object.
SkyObject * findByName(const QString &name, bool exact=true) override
void draw(SkyPainter *skyp) override
Draw the object on the SkyMap skyp a pointer to the SkyPainter to use.
void drawTrails(SkyPainter *skyp) override
Draw trails for objects.
KSPlanetBase * getPlanet() const
Return pointer to stored planet object.
Implements the moons of a planet.
Definition planetmoons.h:30
SkyComponent represents an object on the sky map.
SkyComposite * parent()
SkyComposite is a kind of container class for SkyComponent objects.
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
This class encapsulates some methods which are shared between all single-object solar system componen...
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 24 2024 11:49:23 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.