Kstars

localmeridiancomponent.cpp
1/*
2 SPDX-FileCopyrightText: 2012 Jerome SONRIER <jsid@emor3j.fr.eu.org>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#include "localmeridiancomponent.h"
8
9#include "kstarsdata.h"
10#include "Options.h"
11#include "linelist.h"
12#ifdef KSTARS_LITE
13#include "skymaplite.h"
14#else
15#include "skymap.h"
16#endif
17#include "skypainter.h"
18
20 : CoordinateGrid(parent, i18n("Local Meridian Component"))
21{
22 //KStarsData *data = KStarsData::Instance();
23
24 intro();
25
26 double eps = 0.1;
27 double maxAlt = 90.0;
28
29 std::shared_ptr<LineList> lineList;
30
31 for (double az = 0; az <= 180; az += 180)
32 {
33 lineList.reset(new LineList());
34
35 for (double alt = 0; alt < maxAlt; alt += eps)
36 {
37 std::shared_ptr<SkyPoint> p(new SkyPoint());
38 p->setAz(az);
39 p->setAlt(alt);
40 lineList->append(std::move(p));
41 }
42
43 appendLine(lineList);
44 }
45
46
47
48 summary();
49}
50
52{
53 return (Options::showLocalMeridian() && !(Options::hideOnSlew() &&
55 SkyMap::IsSlewing()));
56 #else
57 SkyMapLite::IsSlewing()));
58#endif
59}
60
62{
63 KStarsData *data = KStarsData::Instance();
64 QColor color = data->colorScheme()->colorNamed("LocalMeridianColor");
65
66 skyp->setPen(QPen(QBrush(color), 2, Qt::SolidLine));
67}
68
70{
71 KStarsData *data = KStarsData::Instance();
72
73 for (int i = 0; i < listList().count(); i++)
74 {
75 for (int j = 0; j < listList().at(i)->points()->count(); j++)
76 {
77 listList().at(i)->points()->at(j)->HorizontalToEquatorial(data->lst(), data->geo()->lat());
78 }
79 }
80}
QColor colorNamed(const QString &name) const
Retrieve a color by name.
Collection of all the circles in the coordinate grid.
const CachingDms * lat() const
Definition geolocation.h:70
There are several time-dependent values used in position calculations, that are not specific to an ob...
Definition ksnumbers.h:43
KStarsData is the backbone of KStars.
Definition kstarsdata.h:72
CachingDms * lst()
Definition kstarsdata.h:224
ColorScheme * colorScheme()
Definition kstarsdata.h:172
GeoLocation * geo()
Definition kstarsdata.h:230
void intro()
displays a message that we are loading m_name.
void summary()
prints out some summary statistics if the skyMesh debug is greater than 1.
void appendLine(const std::shared_ptr< LineList > &lineList)
Typically called from within a subclasses constructors.
A simple data container used by LineListIndex.
Definition linelist.h:25
void preDraw(SkyPainter *skyp) override
Gives the subclasses access to the top of the draw() method.
void update(KSNumbers *) override
Update the sky position(s) of this component.
LocalMeridianComponent(SkyComposite *parent)
Constructor Simply adds all of the coordinate grid circles (meridians and parallels) parent Pointer t...
SkyComposite is a kind of container class for SkyComponent objects.
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
QString i18n(const char *text, const TYPE &arg...)
SolidLine
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 17 2024 11:48:27 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.