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 #include "qwt_scale_div.h"
12 #include "qwt_text.h"
13 
15 {
16 public:
18  orientation( Qt::Vertical )
19  {
20  }
21 
22  Qt::Orientation orientation;
23 };
24 
30  QwtPlotItem( title )
31 {
32  d_data = new PrivateData();
34 }
35 
41  QwtPlotItem( QwtText( title ) )
42 {
43  d_data = new PrivateData();
45 }
46 
49 {
50  delete d_data;
51 }
52 
63 {
64  if ( d_data->orientation != orientation )
65  {
67 
68  legendChanged();
69  itemChanged();
70  }
71 }
72 
77 Qt::Orientation QwtPlotSeriesItem::orientation() const
78 {
79  return d_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 }
virtual void legendChanged()
Qt::Orientation orientation() const
QwtPlotSeriesItem(const QString &title=QString())
A class representing a scale division.
Definition: qwt_scale_div.h:33
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)
A scale map.
Definition: qwt_scale_map.h:26
virtual void itemChanged()
virtual void draw(QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect) const QWT_OVERRIDE
Draw the complete series.
virtual void updateScaleDiv(const QwtScaleDiv &, const QwtScaleDiv &) QWT_OVERRIDE
Update the item to changes of the axes scale division.
double range() const
virtual ~QwtPlotSeriesItem()
Destructor.
virtual void dataChanged() QWT_OVERRIDE
dataChanged() indicates, that the series has been changed.
Base class for items on the plot canvas.
Definition: qwt_plot_item.h:65
void setItemInterest(ItemInterest, bool on=true)
virtual QRectF dataRect() const =0
virtual QRectF boundingRect() const QWT_OVERRIDE
const QwtText & title() const


plotjuggler
Author(s): Davide Faconti
autogenerated on Sun Dec 6 2020 03:48:10