9#include "avtplotwidget.h"
12#include "kstarsdata.h"
13#include "kstarsdatetime.h"
17#include "dialogs/finddialog.h"
18#include "dialogs/locationdialog.h"
19#include "geolocation.h"
20#include "skyobjects/skypoint.h"
21#include "skyobjects/skyobject.h"
22#include "skyobjects/starobject.h"
24#include <KLocalizedString>
25#include <kplotwidget.h>
31#include <QtPrintSupport/QPrinter>
32#include <QtPrintSupport/QPrintDialog>
35#include "kstars_debug.h"
55 avtUI =
new AltVsTimeUI(
this);
60 avtUI->View->addLayer(
"markersLayer", avtUI->View->layer(
"currentCurveLayer"),
QCustomPlot::limAbove);
64 avtUI->View->xAxis->grid()->setVisible(
false);
65 avtUI->View->yAxis->grid()->setVisible(
false);
67 QPen axisPen(axisColor, 1);
68 avtUI->View->xAxis->setBasePen(axisPen);
69 avtUI->View->xAxis->setTickPen(axisPen);
70 avtUI->View->xAxis->setSubTickPen(axisPen);
71 avtUI->View->xAxis->setTickLabelColor(axisColor);
72 avtUI->View->xAxis->setLabelColor(axisColor);
74 avtUI->View->xAxis2->setBasePen(axisPen);
75 avtUI->View->xAxis2->setTickPen(axisPen);
76 avtUI->View->xAxis2->setSubTickPen(axisPen);
77 avtUI->View->xAxis2->setTickLabelColor(axisColor);
78 avtUI->View->xAxis2->setLabelColor(axisColor);
80 avtUI->View->yAxis->setBasePen(axisPen);
81 avtUI->View->yAxis->setTickPen(axisPen);
82 avtUI->View->yAxis->setSubTickPen(axisPen);
83 avtUI->View->yAxis->setTickLabelColor(axisColor);
84 avtUI->View->yAxis->setLabelColor(axisColor);
86 avtUI->View->yAxis2->setBasePen(axisPen);
87 avtUI->View->yAxis2->setTickPen(axisPen);
88 avtUI->View->yAxis2->setSubTickPen(axisPen);
89 avtUI->View->yAxis2->setTickLabelColor(axisColor);
90 avtUI->View->yAxis2->setLabelColor(axisColor);
93 avtUI->View->xAxis2->setLabel(
i18n(
"Local Sidereal Time"));
94 avtUI->View->xAxis2->setVisible(
true);
95 avtUI->View->yAxis2->setVisible(
true);
96 avtUI->View->yAxis2->setTickLength(0, 0);
97 avtUI->View->xAxis->setLabel(
i18n(
"Local Time"));
98 avtUI->View->yAxis->setLabel(
i18n(
"Altitude"));
99 avtUI->View->xAxis->setRange(43200, 129600);
100 avtUI->View->xAxis2->setRange(61200, 147600);
104 xAxisTimeTicker->setTimeFormat(
"%h:%m");
105 xAxisTimeTicker->setTickCount(12);
107 xAxisTimeTicker->setTickOrigin(
Qt::UTC);
108 avtUI->View->xAxis->setTicker(xAxisTimeTicker);
112 xAxis2TimeTicker->setTimeFormat(
"%h:%m");
113 xAxis2TimeTicker->setTickCount(12);
115 xAxis2TimeTicker->setTickOrigin(
Qt::UTC);
116 avtUI->View->xAxis2->setTicker(xAxis2TimeTicker);
119 avtUI->View->axisRect()->setRangeDragAxes(avtUI->View->xAxis2, avtUI->View->yAxis);
120 avtUI->View->axisRect()->setRangeZoomAxes(avtUI->View->xAxis2, avtUI->View->yAxis);
124 avtUI->View->axisRect()->setMargins(
QMargins(0, 0, 7, 0));
131 avtUI->View->setSelectionTolerance(5);
138 background->setPixmap(*gradient);
142 background->setLayer(
"background");
143 background->setVisible(
true);
145 avtUI->raBox->setUnits(dmsBox::HOURS);
146 avtUI->decBox->setUnits(dmsBox::DEGREES);
150 avtUI->longBox->setReadOnly(
true);
151 avtUI->latBox->setReadOnly(
true);
164 geo = KStarsData::Instance()->geo();
171 if (
getDate().time().hour() > 12)
174 avtUI->longBox->show(geo->lng());
175 avtUI->latBox->show(geo->lat());
221 p1.
begin(&blueButton);
233 p2.
begin(&greenButton);
242 avtUI->riseButton->setIcon(
QIcon(redButton));
243 avtUI->setButton->setIcon(
QIcon(blueButton));
244 avtUI->transitButton->setIcon(
QIcon(greenButton));
256 SkyObject *obj = KStarsData::Instance()->objectNamed(avtUI->nameBox->text());
260 obj = KStarsData::Instance()->objectNamed(name);
285 if (!avtUI->nameBox->text().isEmpty() && !avtUI->raBox->text().isEmpty() && !avtUI->decBox->text().isEmpty())
288 dms newRA = avtUI->raBox->createDms(&okRA);
289 dms newDec = avtUI->decBox->createDms(&okDec);
297 long double jd = dt.
djd();
322 deleteList.append(obj);
330 if (avtUI->nameBox->text().isEmpty())
332 avtUI->nameBox->QWidget::setFocus();
334 if (avtUI->raBox->text().isEmpty())
336 avtUI->raBox->QWidget::setFocus();
340 if (avtUI->decBox->text().isEmpty())
341 avtUI->decBox->QWidget::setFocus();
345 avtUI->View->update();
353 SkyObject *o = FindDialog::Instance()->targetObject();
357 avtUI->View->update();
358 avtUI->View->replot();
393 if (found && !forceAdd)
395 qCWarning(KSTARS) <<
"This point is already displayed; It will not be duplicated.";
403 for (
int i = 0; i < avtUI->View->graphCount(); i++)
405 if (avtUI->View->graph(i)->pen().color() ==
Qt::white)
412 avtUI->View->addGraph()->setName(o->
name());
418 for (
double h = -12.0, i = 0; h <= 12.0; h += 0.25, i++)
425 t[i] = i * 900 + 43200;
426 avtUI->View->graph(avtUI->View->graphCount() - 1)->addData(t[i],
y[i]);
428 avtUI->View->graph(avtUI->View->graphCount() - 1)->setPen(
QPen(
Qt::white, 3));
431 avtUI->View->xAxis->setRange(43200, 129600);
432 avtUI->View->xAxis2->setRange(61200, 147600);
433 if (abs(minAlt) > maxAlt)
434 maxAlt = abs(minAlt);
438 avtUI->View->yAxis->setRange(minAlt - offset, maxAlt + offset);
441 background->topLeft->setCoords(avtUI->View->xAxis->range().lower, avtUI->View->yAxis->range().upper);
442 background->bottomRight->setCoords(avtUI->View->xAxis->range().upper, avtUI->View->yAxis->range().lower);
444 avtUI->View->replot();
447 avtUI->PlotList->setCurrentRow(avtUI->PlotList->count() - 1);
448 avtUI->raBox->show(o->
ra());
449 avtUI->decBox->show(o->
dec());
469 hour += 24.0 * DayOffset;
486 for (
int i = 0; i < avtUI->View->graphCount(); i++)
493 avtUI->View->graph(i)->setLayer(
"main");
497 avtUI->View->graph(rowIndex)->setLayer(
"currentCurveLayer");
498 avtUI->View->update();
499 avtUI->View->replot();
501 if (row >= 0 && row < pList.size())
504 avtUI->raBox->show(p->
ra());
505 avtUI->decBox->show(p->
dec());
506 avtUI->nameBox->setText(avtUI->PlotList->currentItem()->text());
509 SkyObject *selectedObject = KStarsData::Instance()->objectNamed(avtUI->nameBox->text());
516 avtUI->riseButton->setEnabled(
false);
517 avtUI->setButton->setEnabled(
false);
521 avtUI->riseButton->setEnabled(
true);
522 avtUI->setButton->setEnabled(
true);
529 QCPRange aux = avtUI->View->xAxis2->range();
530 avtUI->View->xAxis->setRange(aux -= 18000);
531 avtUI->View->xAxis2->setRange(range.
bounded(61200, 147600));
533 if (avtUI->View->xAxis->range().size() != 86400)
536 background->setScaled(
false);
538 background->setPixmap(*gradient);
540 avtUI->View->update();
541 avtUI->View->replot();
548 avtUI->View->yAxis->setRange(range.
bounded(minAlt - offset, maxAlt + offset));
561 double x = avtUI->View->xAxis->pixelToCoord(
event->localPos().x());
562 double y = avtUI->View->yAxis->pixelToCoord(
event->localPos().y());
572 QTime localTime(0, 0, 0, 0);
573 QTime localSiderealTime(5, 0, 0, 0);
575 localTime = localTime.
addSecs(
int(xValue));
576 localSiderealTime = localSiderealTime.
addSecs(
int(xValue));
582 "<th colspan=\"2\">%1</th>"
593 "<td>Altitude: </td>"
597 graph->name().
isEmpty() ?
"???" : graph->name(),
601 avtUI->View, avtUI->View->rect());
611 avtUI->addButton->setFocus();
613 avtUI->decBox->setFocus();
615 avtUI->addButton->setFocus();
617 avtUI->latBox->setFocus();
619 avtUI->updateButton->setFocus();
626 while (!deleteList.isEmpty())
627 delete deleteList.takeFirst();
629 avtUI->PlotList->clear();
630 avtUI->nameBox->clear();
631 avtUI->raBox->clear();
632 avtUI->decBox->clear();
633 avtUI->epochName->clear();
635 avtUI->View->clearGraphs();
638 int indexItem = 0, noItems = avtUI->View->itemCount();
642 while (noItems > 1 && indexItem < noItems)
645 item = avtUI->View->item(indexItem);
652 avtUI->View->removeItem(indexItem);
657 avtUI->View->update();
658 avtUI->View->replot();
663 avtUI->nameBox->clear();
664 avtUI->raBox->clear();
665 avtUI->decBox->clear();
666 avtUI->epochName->clear();
671 if (avtUI->PlotList->currentRow() < 0)
674 SkyObject *selectedObject = pList.at(avtUI->PlotList->currentRow());
675 if (selectedObject ==
nullptr)
677 if (avtUI->PlotList->currentItem())
678 qCWarning(KSTARS) <<
"slotComputeAltitudeByTime: Unable to find" << avtUI->PlotList->currentItem()->text();
681 qCWarning(KSTARS) <<
"slotComputeAltitudeByTime: Unable to find item";
707 if (avtUI->PlotList->currentRow() < 0)
711 SkyObject *selectedObject = pList.at(avtUI->PlotList->currentRow());
712 if (selectedObject ==
nullptr)
714 qCWarning(KSTARS) <<
"Mark Rise Time: Unable to find" << avtUI->PlotList->currentItem()->text();
720 if (avtUI->View->graphCount() > 0)
723 double hours, minutes;
725 QCPGraph *selectedGraph = avtUI->View->graph(avtUI->PlotList->currentRow());
729 if (rt.
isValid() && selectedGraph)
735 time = hours * 3600 + minutes * 60;
737 riseTimeTracer->
setLayer(
"markersLayer");
738 riseTimeTracer->
setGraph(selectedGraph);
746 avtUI->View->update();
747 avtUI->View->replot();
754 if (avtUI->PlotList->currentRow() < 0)
758 SkyObject *selectedObject = pList.at(avtUI->PlotList->currentRow());
759 if (selectedObject ==
nullptr)
761 qCWarning(KSTARS) <<
"Mark Set Time: Unable to find" << avtUI->PlotList->currentItem()->text();
766 if (avtUI->View->graphCount() > 0)
769 double hours, minutes;
771 QCPGraph *selectedGraph = avtUI->View->graph(avtUI->PlotList->currentRow());
785 time = hours * 3600 + minutes * 60;
787 setTimeTracer->
setLayer(
"markersLayer");
788 setTimeTracer->
setGraph(selectedGraph);
796 avtUI->View->update();
797 avtUI->View->replot();
804 if (avtUI->PlotList->currentRow() < 0)
808 SkyObject *selectedObject = pList.at(avtUI->PlotList->currentRow());
809 if (selectedObject ==
nullptr)
811 qCWarning(KSTARS) <<
"Mark Transit Time: Unable to find" << avtUI->PlotList->currentItem()->text();
816 if (avtUI->View->graphCount() > 0)
819 double hours, minutes;
821 QCPGraph *selectedGraph = avtUI->View->graph(avtUI->PlotList->currentRow());
834 time = hours * 3600 + minutes * 60;
836 transitTimeTracer->
setLayer(
"markersLayer");
837 transitTimeTracer->
setGraph(selectedGraph);
842 transitTimeTracer->
setSize(10);
845 avtUI->View->update();
846 avtUI->View->replot();
928 double x = avtUI->View->xAxis->pixelToCoord(
event->localPos().x());
929 double y = avtUI->View->yAxis->pixelToCoord(
event->localPos().y());
933 if (
x > avtUI->View->xAxis->range().lower &&
x < avtUI->View->xAxis->range().upper)
934 if (
y > avtUI->View->yAxis->range().lower &&
y < avtUI->View->yAxis->range().upper)
942 QTime localTime(0, 0, 0, 0);
943 QTime localSiderealTime(5, 0, 0, 0);
945 localTime = localTime.
addSecs(
int(xValue));
946 localSiderealTime = localSiderealTime.
addSecs(
int(xValue));
952 "<th colspan=\"2\">%1</th>"
963 "<td>Altitude: </td>"
967 graph->name().
isEmpty() ?
"???" : graph->name(),
970 avtUI->View, avtUI->View->rect());
976 avtUI->View->update();
977 avtUI->View->replot();
993 for (
int i = 0; i < pList.count(); ++i)
1009 pList.replace(i, o);
1013 double point_altitudeValue, point_timeValue;
1017 for (
double h = -12.0, i = 0; h <= 12.0; h += 0.25, i++)
1020 altitude_dataSet.
push_back(point_altitudeValue);
1021 if (point_altitudeValue > maxAlt)
1022 maxAlt = point_altitudeValue;
1023 if (point_altitudeValue < minAlt)
1024 minAlt = point_altitudeValue;
1025 point_timeValue = i * 900 + 43200;
1026 time_dataSet.
push_back(point_timeValue);
1030 avtUI->View->graph(i)->setData(time_dataSet, altitude_dataSet);
1033 avtUI->View->xAxis->setRange(43200, 129600);
1034 avtUI->View->xAxis2->setRange(61200, 147600);
1037 if (abs(minAlt) > maxAlt)
1038 maxAlt = abs(minAlt);
1041 avtUI->View->yAxis->setRange(minAlt - offset, maxAlt + offset);
1044 background->topLeft->setCoords(avtUI->View->xAxis->range().lower, avtUI->View->yAxis->range().upper);
1045 background->bottomRight->setCoords(avtUI->View->xAxis->range().upper, avtUI->View->yAxis->range().lower);
1048 avtUI->View->replot();
1061 pList.at(i)->updateCoordsNow(num);
1065 double point_altitudeValue, point_timeValue;
1069 for (
double h = -12.0, i = 0; h <= 12.0; h += 0.25, i++)
1072 altitude_dataSet.
push_back(point_altitudeValue);
1073 if (point_altitudeValue > maxAlt)
1074 maxAlt = point_altitudeValue;
1075 if (point_altitudeValue < minAlt)
1076 minAlt = point_altitudeValue;
1077 point_timeValue = i * 900 + 43200;
1078 time_dataSet.
push_back(point_timeValue);
1082 avtUI->View->graph(i)->setData(time_dataSet, altitude_dataSet);
1085 avtUI->View->xAxis->setRange(43200, 129600);
1086 avtUI->View->xAxis2->setRange(61200, 147600);
1089 if (abs(minAlt) > maxAlt)
1090 maxAlt = abs(minAlt);
1093 avtUI->View->yAxis->setRange(minAlt - offset, maxAlt + offset);
1096 background->topLeft->setCoords(avtUI->View->xAxis->range().lower, avtUI->View->yAxis->range().upper);
1097 background->bottomRight->setCoords(avtUI->View->xAxis->range().upper, avtUI->View->yAxis->range().lower);
1100 avtUI->View->replot();
1104 if (
getDate().time().hour() > 12)
1111 avtUI->View->update();
1125 avtUI->latBox->show(geo->lat());
1126 avtUI->longBox->show(geo->lng());
1156void AltVsTime::drawGradient()
1160 GeoLocation *geoLoc = KStarsData::Instance()->geo();
1165 double SunRise, SunSet, Dawn, Dusk, SunMinAlt, SunMaxAlt;
1166 double MoonRise, MoonSet, MoonIllum;
1171 SunRise = ksal.getSunRise();
1172 SunSet = ksal.getSunSet();
1173 SunMaxAlt = ksal.getSunMaxAlt();
1174 SunMinAlt = ksal.getSunMinAlt();
1175 MoonRise = ksal.getMoonRise();
1176 MoonSet = ksal.getMoonSet();
1177 MoonIllum = ksal.getMoonIllum();
1178 Dawn = ksal.getDawnAstronomicalTwilight();
1179 Dusk = ksal.getDuskAstronomicalTwilight();
1181 gradient =
new QPixmap(avtUI->View->
rect().width(), avtUI->View->
rect().height());
1196 QColor SkyColor(0, 100, 200);
1202 if (MoonIllum > 0.01)
1204 int moonrise = int(pW * (0.5 + MoonRise));
1205 int moonset = int(pW * (MoonSet - 0.5));
1210 int moonalpha = int(10 + MoonIllum * 130);
1214 QColor MoonColor(255, 255, 255, moonalpha);
1216 if (moonset < moonrise)
1226 p.
fillRect(
QRectF(moonrise - fadewidth, 0.0, pW - moonrise + fadewidth, pH), grad);
1232 p.
fillRect(QRectF(moonrise + fadewidth, 0.0, moonset - moonrise - 2 * fadewidth, pH), MoonColor);
1233 QLinearGradient grad =
1234 QLinearGradient(QPointF(moonrise + fadewidth, 0.0), QPointF(moonrise - fadewidth, 0.0));
1237 p.
fillRect(QRectF(0.0, 0.0, moonrise + fadewidth, pH), grad);
1238 grad.
setStart(QPointF(moonset - fadewidth, 0.0));
1240 p.
fillRect(QRectF(moonset - fadewidth, 0.0, pW - moonset, pH), grad);
1246 if (SunMaxAlt > -18.0)
1249 int rise = int(pW * (0.5 + SunRise));
1250 int set = int(pW * (SunSet - 0.5));
1251 int da = int(pW * (0.5 + Dawn));
1252 int du = int(pW * (Dusk - 0.5));
1254 if (SunMinAlt > 0.0)
1259 else if (SunMaxAlt < 0.0 && SunMinAlt < -18.0)
1262 QLinearGradient grad = QLinearGradient(QPointF(0.0, 0.0), QPointF(du, 0.0));
1264 QColor gradStartColor = SkyColor;
1265 gradStartColor.
setAlpha((1 - (SunMaxAlt / -18.0)) * 255);
1269 p.
fillRect(QRectF(0.0, 0.0, du, pH), grad);
1272 p.
fillRect(QRectF(da, 0.0, pW, pH), grad);
1274 else if (SunMaxAlt < 0.0 && SunMinAlt > -18.0)
1277 QLinearGradient grad = QLinearGradient(QPointF(0.0, 0.0), QPointF(pW, 0.0));
1279 QColor gradStartEndColor = SkyColor;
1280 gradStartEndColor.
setAlpha((1 - (SunMaxAlt / -18.0)) * 255);
1281 QColor gradMidColor = SkyColor;
1282 gradMidColor.
setAlpha((1 - (SunMinAlt / -18.0)) * 255);
1287 p.
fillRect(QRectF(0.0, 0.0, pW, pH), grad);
1289 else if (Dawn < 0.0)
1292 p.
fillRect(0, 0, set,
int(0.5 * pH), SkyColor);
1293 p.
fillRect(rise, 0, pW,
int(0.5 * pH), SkyColor);
1295 QLinearGradient grad = QLinearGradient(QPointF(set, 0.0), QPointF(rise, 0.0));
1297 QColor gradMidColor = SkyColor;
1298 gradMidColor.
setAlpha((1 - (SunMinAlt / -18.0)) * 255);
1303 p.
fillRect(QRectF(set, 0.0, rise - set, pH), grad);
1307 p.
fillRect(0, 0, set, pH, SkyColor);
1308 p.
fillRect(rise, 0, pW, pH, SkyColor);
1310 QLinearGradient grad = QLinearGradient(QPointF(set, 0.0), QPointF(du, 0.0));
1315 p.
fillRect(QRectF(set, 0.0, du - set, pH), grad);
1319 p.
fillRect(QRectF(da, 0.0, rise - da, pH), grad);
1323 p.
fillRect(0,
int(0.5 * pH), pW,
int(0.5 * pH), KStarsData::Instance()->colorScheme()->colorNamed(
"HorzColor"));
1336 int ix = int(
x * pW / 24.0);
1341 QFont largeFont = p.
font();
1366 double epoch = eName.
toDouble(&ok);
1369 qCWarning(KSTARS) <<
"Invalid Epoch. Assuming 2000.0.";
1375void AltVsTime::setDawnDusk()
1394 int text_height = 200;
1413 plot_font = avtUI->View->font();
1417 plot_size = avtUI->View->size();
1420 str_legend =
i18n(
"Elevation vs. Time Plot");
1422 str_legend += geo->fullName();
1423 str_legend +=
" - ";
1424 str_legend += avtUI->DateWidget->date().toString(
"dd/MM/yyyy");
1427 QRect text_rect(0, 0, printer.
width(), text_height);
1431 avtUI->View->setFont(plot_font);
1433 avtUI->View->resize(printer.
width(), printer.
height() - text_height);
1436 QPixmap pixmap(avtUI->View->size());
1437 avtUI->View->render(&pixmap);
1450 avtUI->View->setFont(plot_font);
1452 avtUI->View->resize(plot_size);
1463 if (o->
name() ==
"star")
1474 return finalObjectName;
AltVsTime(QWidget *parent=nullptr)
Constructor.
void slotAddSource()
Add an object to the list of displayed objects, according to the data entered in the edit boxes.
void slotHighlight(int)
Update the plot to highlight the altitude curve of the objects which is highlighted in the listbox.
double findAltitude(SkyPoint *p, double hour)
Determine the altitude coordinate of a SkyPoint, given an hour of the day.
void slotPrint()
Print plot widget.
void slotMarkSetTime()
Mark the set time on the curve.
void showCurrentDate()
Set the AltVsTime Date according to the current Date in the KStars main window.
void setLSTLimits()
Determine the limits for the sideral time axis, using the sidereal time at midnight for the current d...
void plotMousePress(QCPAbstractPlottable *abstractPlottable, int dataIndex, QMouseEvent *event)
Show information from the curve as a tooltip.
void slotBrowseObject()
Launch the Find Object window to select a new object for the list of displayed objects.
void slotClearBoxes()
Clear the edit boxes for specifying a new object.
void slotChooseCity()
Launch the Location dialog to choose a new location.
void slotMarkTransitTime()
Mark the transit time on the curve.
double getEpoch(const QString &eName)
Parse a string as an epoch number.
void mouseOverLine(QMouseEvent *event)
Draw the white vertical line on click.
void onXRangeChanged(const QCPRange &range)
Update the X axis on Zoom and Drag.
void computeSunRiseSetTimes()
Determine the time of sunset and sunrise for the current date and location settings.
void slotUpdateDateLoc()
Update the plot to reflec new Date and Location settings.
void slotClear()
Clear the list of displayed objects.
void processObject(SkyObject *o, bool forceAdd=false)
Add a SkyObject to the display.
void slotMarkRiseTime()
Mark the rise time on the curve.
~AltVsTime() override
Destructor.
void onYRangeChanged(const QCPRange &range)
Update the Y axis on Zoom and Drag.
void slotAdvanceFocus()
Move input keyboard focus to the next logical widget.
void slotComputeAltitudeByTime()
Compute the altitude for a certain time.
QString getObjectName(const SkyObject *o, bool translated=true)
get object name.
a dms subclass that caches its sine and cosine values every time the angle is changed.
static QString processSearchText(QString searchText)
Do some post processing on the search text to interpret what the user meant This could include replac...
Contains all relevant information for specifying a location on Earth: City Name, State/Province name,...
const CachingDms * lat() const
A class that implements methods to find sun rise, sun set, twilight begin / end times,...
There are several time-dependent values used in position calculations, that are not specific to an ob...
KStarsData is the backbone of KStars.
const KStarsDateTime & ut() const
Extension of QDateTime for KStars KStarsDateTime can represent the date/time as a Julian Day,...
KStarsDateTime addDays(int nd) const
Modify the Date/Time by adding a number of days.
KStarsDateTime addSecs(double s) const
bool setFromEpoch(double e, EpochType type)
Set the Date/Time from an epoch value, represented as a double.
void setDate(const QDate &d)
Assign the Date according to a QDate object.
static KStarsDateTime currentDateTimeUtc()
static KStarsDateTime currentDateTime()
Dialog for changing the geographic location of the observer.
The abstract base class for all items in a plot.
The abstract base class for all data representing objects in a plot.
Specialized axis ticker for time spans in units of milliseconds to days.
@ tssReadability
A nicely readable tick step is prioritized over matching the requested number of ticks (see setTickCo...
A plottable representing a graph in a plot.
@ ptPlotCoords
Dynamic positioning at a plot coordinate defined by two axes (see setAxes).
Item that sticks to QCPGraph data points.
void setBrush(const QBrush &brush)
void setStyle(TracerStyle style)
void setGraphKey(double key)
void setInterpolating(bool enabled)
void setSize(double size)
void setGraph(QCPGraph *graph)
void setPen(const QPen &pen)
Q_SLOT bool setLayer(QCPLayer *layer)
Represents the range an axis is encompassing.
QCPRange bounded(double lowerBound, double upperBound) const
@ limAbove
Layer is inserted above other layer.
Provides all necessary information about an object in the sky: its coordinates, name(s),...
virtual SkyObject * clone() const
Create copy of object.
QString translatedName() const
virtual QString name(void) const
bool isSolarSystem() const
QTime transitTime(const KStarsDateTime &dt, const GeoLocation *geo) const
The same iteration technique described in riseSetTime() is used here.
QTime riseSetTime(const KStarsDateTime &dt, const GeoLocation *geo, bool rst, bool exact=true) const
Determine the time at which the point will rise or set.
The sky coordinates of a point in the sky.
const CachingDms & dec() const
virtual void updateCoordsNow(const KSNumbers *num)
updateCoordsNow Shortcut for updateCoords( const KSNumbers *num, false, nullptr, nullptr,...
const CachingDms & ra() const
void EquatorialToHorizontal(const CachingDms *LST, const CachingDms *lat)
Determine the (Altitude, Azimuth) coordinates of the SkyPoint from its (RA, Dec) coordinates,...
virtual void updateCoords(const KSNumbers *num, bool includePlanets=true, const CachingDms *lat=nullptr, const CachingDms *LST=nullptr, bool forceRecompute=false)
Determine the current coordinates (RA, Dec) from the catalog coordinates (RA0, Dec0),...
SkyPoint catalogueCoord(long double jdf)
Computes the J2000.0 catalogue coordinates for this SkyPoint using the epoch removing aberration,...
This is a subclass of SkyObject.
An angle, stored as degrees, but expressible in many ways.
virtual void setH(const double &x)
Sets floating-point value of angle, in hours.
const QString toDMSString(const bool forceSign=false, const bool machineReadable=false, const bool highPrecision=false) const
virtual void setD(const double &x)
Sets floating-point value of angle, in degrees.
const double & Degrees() const
QString i18nc(const char *context, const char *text, const TYPE &arg...)
QString i18n(const char *text, const TYPE &arg...)
char * toString(const EngineQuery &query)
@ iRangeDrag
0x001 Axis ranges are draggable (see QCPAxisRect::setRangeDrag, QCPAxisRect::setRangeDragAxes)
@ iRangeZoom
0x002 Axis ranges are zoomable with the mouse wheel (see QCPAxisRect::setRangeZoom,...
@ msBottom
0x08 bottom margin
QDialog(QWidget *parent, Qt::WindowFlags f)
void setModal(bool modal)
int pointSize() const const
void setPointSize(int pointSize)
void setColorAt(qreal position, const QColor &color)
void restoreOverrideCursor()
void setOverrideCursor(const QCursor &cursor)
QIcon fromTheme(const QString &name)
void setContentsMargins(const QMargins &margins)
void setFinalStop(const QPointF &stop)
void setStart(const QPointF &start)
void push_back(parameter_type value)
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
QObject * parent() const const
T qobject_cast(QObject *object)
QObject * sender() const const
bool begin(QPaintDevice *device)
void drawEllipse(const QPoint ¢er, int rx, int ry)
void drawLine(const QLine &line)
void drawPixmap(const QPoint &point, const QPixmap &pixmap)
void drawText(const QPoint &position, const QString &text)
void fillRect(const QRect &rectangle, QGradient::Preset preset)
const QFont & font() const const
qreal opacity() const const
void setBrush(Qt::BrushStyle style)
void setClipRect(const QRect &rectangle, Qt::ClipOperation operation)
void setClipping(bool enable)
void setFont(const QFont &font)
void setOpacity(qreal opacity)
void setPen(Qt::PenStyle style)
void setRenderHint(RenderHint hint, bool on)
void translate(const QPoint &offset)
void fill(const QColor &color)
virtual int exec() override
void setResolution(int dpi)
QString arg(Args &&... args) const const
bool isEmpty() const const
QString number(double n, char format, int precision)
double toDouble(bool *ok) const const
QTime addSecs(int s) const const
bool isValid(int h, int m, int s, int ms)
QString toString(QStringView format) const const
void showText(const QPoint &pos, const QString &text, QWidget *w, const QRect &rect, int msecDisplayTime)