qwt_plot_seriesitem.cpp
Go to the documentation of this file.
1 /* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
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 
13 {
14 public:
16  orientation( Qt::Vertical )
17  {
18  }
19 
20  Qt::Orientation orientation;
21 };
22 
28  QwtPlotItem( title )
29 {
30  d_data = new PrivateData();
32 }
33 
39  QwtPlotItem( QwtText( title ) )
40 {
41  d_data = new PrivateData();
42 }
43 
46 {
47  delete d_data;
48 }
49 
60 {
61  if ( d_data->orientation != orientation )
62  {
64 
65  legendChanged();
66  itemChanged();
67  }
68 }
69 
74 Qt::Orientation QwtPlotSeriesItem::orientation() const
75 {
76  return d_data->orientation;
77 }
78 
87 void QwtPlotSeriesItem::draw( QPainter *painter,
88  const QwtScaleMap &xMap, const QwtScaleMap &yMap,
89  const QRectF &canvasRect ) const
90 {
91  drawSeries( painter, xMap, yMap, canvasRect, 0, -1 );
92 }
93 
95 {
96  return dataRect();
97 }
98 
100  const QwtScaleDiv &xScaleDiv, const QwtScaleDiv &yScaleDiv )
101 {
102  const QRectF rect = QRectF(
103  xScaleDiv.lowerBound(), yScaleDiv.lowerBound(),
104  xScaleDiv.range(), yScaleDiv.range() );
105 
106  setRectOfInterest( rect );
107 }
108 
110 {
111  itemChanged();
112 }
virtual void legendChanged()
Qt::Orientation orientation() const
virtual void dataChanged()
dataChanged() indicates, that the series has been changed.
virtual void updateScaleDiv(const QwtScaleDiv &, const QwtScaleDiv &)
Update the item to changes of the axes scale division.
QwtPlotSeriesItem(const QString &title=QString())
A class representing a scale division.
Definition: qwt_scale_div.h:36
virtual void setRectOfInterest(const QRectF &)=0
virtual void drawSeries(QPainter *painter, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, int from, int to) const =0
double lowerBound() const
A class representing a text.
Definition: qwt_text.h:51
void setOrientation(Qt::Orientation)
virtual QRectF boundingRect() const
A scale map.
Definition: qwt_scale_map.h:30
virtual void itemChanged()
virtual void draw(QPainter *p, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &) const
Draw the complete series.
double range() const
virtual ~QwtPlotSeriesItem()
Destructor.
Base class for items on the plot canvas.
Definition: qwt_plot_item.h:64
void setItemInterest(ItemInterest, bool on=true)
virtual QRectF dataRect() const =0
const QwtText & title() const


plotjuggler
Author(s): Davide Faconti
autogenerated on Sat Jul 6 2019 03:44:17