Updraft  1.0
Open source glider flight visualisation tool.
Updraft::IgcViewer::PlotAxes Class Reference

X and Y axis for graph plotting. More...

#include <plotaxes.h>

Collaboration diagram for Updraft::IgcViewer::PlotAxes:

List of all members.

Signals

void geometryChanged ()

Public Member Functions

 PlotAxes (bool drawTimeTicks=true, bool drawAxisX=true)
qreal placeX (qreal x)
 Get the X coordinate for drawing.
qreal getInverseX (qreal x)
 Get the inverse value for "placeX".
qreal placeY (qreal y)
 Get the Y coordinate for drawing.
qreal getInverseY (qreal y)
 Get the inverse value for "placeY".
void setLimits (qreal min, qreal max, qreal minTime, qreal maxTime)
 Set the limits for drawing and recalculate all cached values.
void draw (QPainter *painter)
 Draw the axes to the painter.
qreal getBase ()
 Returns the Y coordinate of base axis: the Y coordinate of value 0.
qreal getStep ()
 Returns the value of the vertical step.
qreal getFirst ()
 Returns the value of the first vertical tick.
int getTimeInterval ()
 Returns the value of time interval in seconds.
qreal getStartTimeTick ()
 Returns the value of the time start in seconds.
int getVerticalTicks ()
 Returns the number of the vertical ticks.
int getFirstHour ()
 Returns the value of the time start in seconds.
int getLastHour ()
 Returns the number of the vertical ticks.
Qt::Orientations expandingDirections () const
 Overridden from QLayoutItem.
bool isEmpty () const
QRect geometry () const
QSize maximumSize () const
QSize minimumSize () const
QSize sizeHint () const
void setGeometry (const QRect &rect)

Private Member Functions

void emitGeometryChanged ()
 Signal change of geometry.
qreal findTickIncrement (qreal range, qreal width, qreal minTickSpacing)
 Return tick value increment in vertical axis.
qreal findTimeTickIncrement (qreal range, qreal width, qreal minTickSpacing)
 Return tick value increment in vertical axis.

Private Attributes

Util::LinearFunc linX
 Linear functions for placing points.
Util::LinearFunc linY
Util::LinearFunc tickX
Util::LinearFunc tickY
int tickCountX
int tickCountY
QRect rect
qreal min
qreal max
qreal maxTime
qreal minTime
bool drawTimeTicks
 Draw time ticks.
bool drawAxisX
 Whether to draw the X axis.
qreal base
 Position (in drawing cordinates) of the X base.
qreal step
 A step in vertical axis.
qreal first
 The value of the first vertical tick.
int timeInterval
 The step in time axis in seconds.
int startTimeTick
 The start time in seconds.
int firstHour
 First and last hour for labels.
int lastHour
QVector< int > timeIntervalValues
 Predefined time interval values.

Static Private Attributes

static const int TICK_SPACING_X = 10
 Smallest distance between ticks.
static const int TICK_SPACING_Y = 10
static const int TIME_TICK_HEIGHT = 10
static const QPen AXES_PEN = QPen(QBrush(Qt::gray), 2)
static const QPen TICKS_PEN = QPen(QBrush(Qt::gray), 0, Qt::DotLine)
static const QPen TIME_TICKS_PEN = QPen(QBrush(Qt::gray), 1)

Detailed Description

X and Y axis for graph plotting.


Constructor & Destructor Documentation

Updraft::IgcViewer::PlotAxes::PlotAxes ( bool  drawTimeTicks = true,
bool  drawAxisX = true 
) [explicit]

Member Function Documentation

void Updraft::IgcViewer::PlotAxes::draw ( QPainter *  painter)

Draw the axes to the painter.

Signal change of geometry.

Overridden from QLayoutItem.

qreal Updraft::IgcViewer::PlotAxes::findTickIncrement ( qreal  range,
qreal  width,
qreal  minTickSpacing 
) [private]

Return tick value increment in vertical axis.

qreal Updraft::IgcViewer::PlotAxes::findTimeTickIncrement ( qreal  range,
qreal  width,
qreal  minTickSpacing 
) [private]

Return tick value increment in vertical axis.

Returns the Y coordinate of base axis: the Y coordinate of value 0.

Returns the value of the first vertical tick.

Returns the value of the time start in seconds.

Get the inverse value for "placeX".

Get the inverse value for "placeY".

Returns the number of the vertical ticks.

Returns the value of the time start in seconds.

Returns the value of the vertical step.

Returns the value of time interval in seconds.

Returns the number of the vertical ticks.

Get the X coordinate for drawing.

Get the Y coordinate for drawing.

void Updraft::IgcViewer::PlotAxes::setGeometry ( const QRect &  rect)

time axis:

vertical axis:

void Updraft::IgcViewer::PlotAxes::setLimits ( qreal  min,
qreal  max,
qreal  minTime,
qreal  maxTime 
)

Set the limits for drawing and recalculate all cached values.


Member Data Documentation

const QPen Updraft::IgcViewer::PlotAxes::AXES_PEN = QPen(QBrush(Qt::gray), 2) [static, private]

Position (in drawing cordinates) of the X base.

Whether to draw the X axis.

Draw time ticks.

The value of the first vertical tick.

First and last hour for labels.

Linear functions for placing points.

The start time in seconds.

A step in vertical axis.

const int Updraft::IgcViewer::PlotAxes::TICK_SPACING_X = 10 [static, private]

Smallest distance between ticks.

const int Updraft::IgcViewer::PlotAxes::TICK_SPACING_Y = 10 [static, private]
const QPen Updraft::IgcViewer::PlotAxes::TICKS_PEN = QPen(QBrush(Qt::gray), 0, Qt::DotLine) [static, private]
const int Updraft::IgcViewer::PlotAxes::TIME_TICK_HEIGHT = 10 [static, private]
const QPen Updraft::IgcViewer::PlotAxes::TIME_TICKS_PEN = QPen(QBrush(Qt::gray), 1) [static, private]

The step in time axis in seconds.

Predefined time interval values.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines