Kstars

planetviewer.h
1/*
2 SPDX-FileCopyrightText: 2003 Jason Harris <jharris@30doradus.org>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "kstarsdatetime.h"
10#include "ui_planetviewer.h"
11
12#include <QDialog>
13#include <QTimer>
14
15class QKeyEvent;
16class QPaintEvent;
17
18#define AUMAX 48
19
20class KSPlanetBase;
21
22class PlanetViewerUI : public QFrame, public Ui::PlanetViewer
23{
25
26 public:
27 explicit PlanetViewerUI(QWidget *parent = nullptr);
28};
29
30/**
31 * @class PlanetViewer
32 * @short Display an overhead view of the solar system
33 *
34 * @version 1.0
35 * @author Jason Harris
36 */
37class PlanetViewer : public QDialog
38{
40
41 public:
42 explicit PlanetViewer(QWidget *parent = nullptr);
43
44 inline QString centerPlanet() const { return CenterPlanet; }
45 inline void setCenterPlanet(const QString &cp) { CenterPlanet = cp; }
46
47 inline KPlotObject *planetObject(uint i) const { return planet[i]; }
48 QString planetName(uint i) const;
49
50 protected:
51 void keyPressEvent(QKeyEvent *e) override;
52 void paintEvent(QPaintEvent *) override;
53
54 private slots:
55 void initPlotObjects();
56 void tick();
57 void setTimeScale(float);
58 void slotChangeDate();
59 void slotRunClock();
60 void slotToday();
61 void slotCloseWindow();
62
63 private:
64 void updatePlanets();
65
66 PlanetViewerUI *pw { nullptr };
68 double scale { 0 };
69 bool isClockRunning { false };
70 QTimer tmr;
71 int UpdateInterval[9], LastUpdate[9];
72 QString CenterPlanet;
73 QList<KSPlanetBase *> PlanetList;
74 KPlotObject *ksun { nullptr };
75 KPlotObject *planet[9] { nullptr };
76};
A subclass of TrailObject that provides additional information needed for most solar system objects.
Extension of QDateTime for KStars KStarsDateTime can represent the date/time as a Julian Day,...
Display an overhead view of the solar system.
Q_OBJECTQ_OBJECT
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:16:42 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.