Merged in f5soh/librepilot/update_credits (pull request #529)
[librepilot.git] / ground / gcs / src / libs / qwt / src / qwt_plot_seriesitem.cpp
blobe5007efed22ab9af03302a036a14846e12135a9c
1 /* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
2 * Qwt Widget Library
3 * Copyright (C) 1997 Josef Wilgen
4 * Copyright (C) 2002 Uwe Rathmann
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the Qwt License, Version 1.0
8 *****************************************************************************/
10 #include "qwt_plot_seriesitem.h"
12 class QwtPlotSeriesItem::PrivateData
14 public:
15 PrivateData():
16 orientation( Qt::Vertical )
20 Qt::Orientation orientation;
23 /*!
24 Constructor
25 \param title Title of the curve
27 QwtPlotSeriesItem::QwtPlotSeriesItem( const QwtText &title ):
28 QwtPlotItem( title )
30 d_data = new PrivateData();
31 setItemInterest( QwtPlotItem::ScaleInterest, true );
34 /*!
35 Constructor
36 \param title Title of the curve
38 QwtPlotSeriesItem::QwtPlotSeriesItem( const QString &title ):
39 QwtPlotItem( QwtText( title ) )
41 d_data = new PrivateData();
44 //! Destructor
45 QwtPlotSeriesItem::~QwtPlotSeriesItem()
47 delete d_data;
50 /*!
51 Set the orientation of the item.
53 The orientation() might be used in specific way by a plot item.
54 F.e. a QwtPlotCurve uses it to identify how to display the curve
55 int QwtPlotCurve::Steps or QwtPlotCurve::Sticks style.
57 \sa orientation()
59 void QwtPlotSeriesItem::setOrientation( Qt::Orientation orientation )
61 if ( d_data->orientation != orientation )
63 d_data->orientation = orientation;
65 legendChanged();
66 itemChanged();
70 /*!
71 \return Orientation of the plot item
72 \sa setOrientation()
74 Qt::Orientation QwtPlotSeriesItem::orientation() const
76 return d_data->orientation;
79 /*!
80 \brief Draw the complete series
82 \param painter Painter
83 \param xMap Maps x-values into pixel coordinates.
84 \param yMap Maps y-values into pixel coordinates.
85 \param canvasRect Contents rectangle of the canvas
87 void QwtPlotSeriesItem::draw( QPainter *painter,
88 const QwtScaleMap &xMap, const QwtScaleMap &yMap,
89 const QRectF &canvasRect ) const
91 drawSeries( painter, xMap, yMap, canvasRect, 0, -1 );
94 QRectF QwtPlotSeriesItem::boundingRect() const
96 return dataRect();
99 void QwtPlotSeriesItem::updateScaleDiv(
100 const QwtScaleDiv &xScaleDiv, const QwtScaleDiv &yScaleDiv )
102 const QRectF rect = QRectF(
103 xScaleDiv.lowerBound(), yScaleDiv.lowerBound(),
104 xScaleDiv.range(), yScaleDiv.range() );
106 setRectOfInterest( rect );
109 void QwtPlotSeriesItem::dataChanged()
111 itemChanged();