qwt_plot_seriesitem.cpp
Go to the documentation of this file.
1 /******************************************************************************
2  * Qwt Widget Library
3  * Copyright (C) 1997 Josef Wilgen
4  * Copyright (C) 2002 Uwe Rathmann
5  *
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  *****************************************************************************/
9 
10 #include "qwt_plot_seriesitem.h"
11 #include "qwt_scale_div.h"
12 #include "qwt_text.h"
13 
15 {
16  public:
17  PrivateData()
18  : orientation( Qt::Vertical )
19  {
20  }
21 
22  Qt::Orientation orientation;
23 };
24 
30  : QwtPlotItem( title )
31 {
32  m_data = new PrivateData();
34 }
35 
40 QwtPlotSeriesItem::QwtPlotSeriesItem( const QString& title )
41  : QwtPlotItem( QwtText( title ) )
42 {
43  m_data = new PrivateData();
45 }
46 
49 {
50  delete m_data;
51 }
52 
62 void QwtPlotSeriesItem::setOrientation( Qt::Orientation orientation )
63 {
64  if ( m_data->orientation != orientation )
65  {
67 
68  legendChanged();
69  itemChanged();
70  }
71 }
72 
77 Qt::Orientation QwtPlotSeriesItem::orientation() const
78 {
79  return m_data->orientation;
80 }
81 
90 void QwtPlotSeriesItem::draw( QPainter* painter,
91  const QwtScaleMap& xMap, const QwtScaleMap& yMap,
92  const QRectF& canvasRect ) const
93 {
94  drawSeries( painter, xMap, yMap, canvasRect, 0, -1 );
95 }
96 
98 {
99  return dataRect();
100 }
101 
103  const QwtScaleDiv& xScaleDiv, const QwtScaleDiv& yScaleDiv )
104 {
105  const QRectF rect = QRectF(
106  xScaleDiv.lowerBound(), yScaleDiv.lowerBound(),
107  xScaleDiv.range(), yScaleDiv.range() );
108 
109  setRectOfInterest( rect );
110 }
111 
113 {
114  itemChanged();
115 }
QwtPlotItem::setItemInterest
void setItemInterest(ItemInterest, bool on=true)
Definition: qwt_plot_item.cpp:279
QwtAbstractSeriesStore::setRectOfInterest
virtual void setRectOfInterest(const QRectF &)=0
QwtScaleDiv::range
double range() const
Definition: qwt_scale_div.cpp:159
QwtPlotSeriesItem::PrivateData::orientation
Qt::Orientation orientation
Definition: qwt_plot_seriesitem.cpp:29
qwt_scale_div.h
QwtPlotItem::legendChanged
virtual void legendChanged()
Definition: qwt_plot_item.cpp:491
QwtPlotSeriesItem::orientation
Qt::Orientation orientation() const
Definition: qwt_plot_seriesitem.cpp:77
QwtPlotSeriesItem::QwtPlotSeriesItem
QwtPlotSeriesItem(const QString &title=QString())
Definition: qwt_plot_seriesitem.cpp:40
QwtScaleDiv::lowerBound
double lowerBound() const
Definition: qwt_scale_div.cpp:131
QwtPlotSeriesItem::m_data
PrivateData * m_data
Definition: qwt_plot_seriesitem.h:64
QwtAbstractSeriesStore::dataRect
virtual QRectF dataRect() const =0
QwtText
A class representing a text.
Definition: qwt_text.h:51
QwtPlotItem
Base class for items on the plot canvas.
Definition: qwt_plot_item.h:66
QwtPlotItem::itemChanged
virtual void itemChanged()
Definition: qwt_plot_item.cpp:481
QwtScaleMap
A scale map.
Definition: qwt_scale_map.h:26
QwtPlotSeriesItem::setOrientation
void setOrientation(Qt::Orientation)
Definition: qwt_plot_seriesitem.cpp:62
QwtPlotSeriesItem::drawSeries
virtual void drawSeries(QPainter *painter, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, int from, int to) const =0
QwtPlotSeriesItem::dataChanged
virtual void dataChanged() QWT_OVERRIDE
dataChanged() indicates, that the series has been changed.
Definition: qwt_plot_seriesitem.cpp:112
QwtPlotSeriesItem::PrivateData
Definition: qwt_plot_seriesitem.cpp:14
qwt_plot_seriesitem.h
QwtPlotSeriesItem::PrivateData::PrivateData
PrivateData()
Definition: qwt_plot_seriesitem.cpp:24
QwtPlotSeriesItem::draw
virtual void draw(QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect) const QWT_OVERRIDE
Draw the complete series.
Definition: qwt_plot_seriesitem.cpp:90
QwtPlotSeriesItem::boundingRect
virtual QRectF boundingRect() const QWT_OVERRIDE
Definition: qwt_plot_seriesitem.cpp:97
QwtScaleDiv
A class representing a scale division.
Definition: qwt_scale_div.h:33
qwt_text.h
QwtPlotItem::ScaleInterest
@ ScaleInterest
Definition: qwt_plot_item.h:185
QwtPlotSeriesItem::updateScaleDiv
virtual void updateScaleDiv(const QwtScaleDiv &, const QwtScaleDiv &) QWT_OVERRIDE
Update the item to changes of the axes scale division.
Definition: qwt_plot_seriesitem.cpp:102
QwtPlotSeriesItem::~QwtPlotSeriesItem
virtual ~QwtPlotSeriesItem()
Destructor.
Definition: qwt_plot_seriesitem.cpp:48


plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Nov 11 2024 03:23:46