Stellarium
1.2
|
#include <AstroCalcChart.hpp>
Public Slots | |
virtual void | retranslate () |
void | showToolTip (const QPointF &point, bool show) |
A slot to connect the hovered signal from a series to. More... | |
Public Member Functions | |
AstroCalcChart (QSet< AstroCalcChart::Series > which) | |
void | append (Series s, qint64 x, qreal y) |
Append one pair of data values to series s. x must be some QDateTime.toMSecsSinceEpoch() | |
void | replace (Series s, int index, qreal x, qreal y) |
Replace one pair of data values to series s at position index. | |
void | clear (Series s) |
Reset (delete and create new empty) series s. | |
int | lengthOfSeries (Series s) const |
void | show (Series s) |
Activate series s. More... | |
void | setYrange (Series series, qreal min, qreal max, bool strictMin=false) |
Set range of Y axis required by the Y values of series. More... | |
void | setYrange (Series series, QPair< double, double > yRange, bool strictMin=false) |
Convenience function. | |
void | setYrangeR (Series series, qreal min, qreal max) |
Set range of Y axis on the right side required by the Y values of series. Do not set buffers or logical limits here, these are determined in this function. | |
void | setYrangeR (Series series, QPair< double, double > yRangeR) |
Convenience function. | |
QPair< double, double > | findYRange (const Series series) const |
Find range of values for the respective series plot. | |
QPair< double, double > | findYMax (const Series series) const |
Find x/y values where y=max for the respective series plot. | |
void | setupAxes (const double jd, const int periods, const QString &englishName) |
Setup axes and appearance. More... | |
void | drawTrivialLineX (Series s, const qreal x) |
Draw a 2-point vertical line at x which extends over the whole graph. | |
void | drawTrivialLineY (Series s, const qreal y) |
Draw a 2-point horizontal line at y which extends over the whole graph. | |
Protected Member Functions | |
virtual void | mousePressEvent (QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE |
Override. This sets the time from the click point to the main application. | |
This class extends QChart and encapsulates data for the Altitude vs. Time and the other line Charts in AstroCalcDialog. Most lines can be QSplineSeries, however the azimuth and magnitude lines must use QLineSeries to avoid a "spline tremor" at the 0/360° transition or where some moon enters the shadow of its planet.
Additional features:
The correct sequence of use:
The time coordinate is displayed using a QDateTimeAxis. Given slight differences between QDateTime and Stellarium's understanding of timezones etc., we must circumvent Qt's automatic handling of local timezones and work as if the time axis would display UTC dates, however, the actual data are in our own timezone frame. This requires manipulation of the x values: From the data which are computed in JD, plot them in UT+zoneOffset. Clicked time is delivered as "UT" and must add zoneOffset as well.
int AstroCalcChart::lengthOfSeries | ( | Series | s | ) | const |
void AstroCalcChart::setupAxes | ( | const double | jd, |
const int | periods, | ||
const QString & | englishName | ||
) |
Call this at the end of drawing, just before display but after all series have been activated with show().
void AstroCalcChart::setYrange | ( | Series | series, |
qreal | min, | ||
qreal | max, | ||
bool | strictMin = false |
||
) |
Do not set buffers or logical limits here, these are determined in this function.
void AstroCalcChart::show | ( | Series | s | ) |
It must have been filled using append(s, ., .) before. Make sure to call setupAxes() after calling show!
|
slot |
It shows the value of the series in a Tooltip on mouse-over.