qwt_plot_item.h
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 #ifndef QWT_PLOT_ITEM_H
11 #define QWT_PLOT_ITEM_H
12 
13 #include "qwt_global.h"
14 #include <qmetatype.h>
15 
16 class QwtScaleMap;
17 class QwtScaleDiv;
18 class QwtPlot;
19 class QwtText;
20 class QwtGraphic;
21 class QwtLegendData;
22 class QRectF;
23 class QPainter;
24 class QString;
25 template <typename T> class QList;
26 
66 {
67 public:
75  {
77  Rtti_PlotItem = 0,
78 
81 
84 
87 
90 
93 
96 
99 
102 
105 
108 
111 
114 
117 
120 
123 
126 
129 
134  Rtti_PlotUserItem = 1000
135  };
136 
147  {
149  Legend = 0x01,
150 
156  AutoScale = 0x02,
157 
163  Margins = 0x04
164  };
165 
167  typedef QFlags<ItemAttribute> ItemAttributes;
168 
180  {
185  ScaleInterest = 0x01,
186 
197  LegendInterest = 0x02
198  };
199 
201  typedef QFlags<ItemInterest> ItemInterests;
202 
205  {
207  RenderAntialiased = 0x1
208  };
209 
211  typedef QFlags<RenderHint> RenderHints;
212 
213  explicit QwtPlotItem();
214  explicit QwtPlotItem( const QString &title );
215  explicit QwtPlotItem( const QwtText &title );
216 
217  virtual ~QwtPlotItem();
218 
219  void attach( QwtPlot *plot );
220  void detach();
221 
222  QwtPlot *plot() const;
223 
224  void setTitle( const QString &title );
225  void setTitle( const QwtText &title );
226  const QwtText &title() const;
227 
228  virtual int rtti() const;
229 
230  void setItemAttribute( ItemAttribute, bool on = true );
231  bool testItemAttribute( ItemAttribute ) const;
232 
233  void setItemInterest( ItemInterest, bool on = true );
234  bool testItemInterest( ItemInterest ) const;
235 
236  void setRenderHint( RenderHint, bool on = true );
237  bool testRenderHint( RenderHint ) const;
238 
239  void setRenderThreadCount( uint numThreads );
240  uint renderThreadCount() const;
241 
242  void setLegendIconSize( const QSize & );
243  QSize legendIconSize() const;
244 
245  double z() const;
246  void setZ( double z );
247 
248  void show();
249  void hide();
250  virtual void setVisible( bool );
251  bool isVisible () const;
252 
253  void setAxes( int xAxis, int yAxis );
254 
255  void setXAxis( int axis );
256  int xAxis() const;
257 
258  void setYAxis( int axis );
259  int yAxis() const;
260 
261  virtual void itemChanged();
262  virtual void legendChanged();
263 
272  virtual void draw( QPainter *painter,
273  const QwtScaleMap &xMap, const QwtScaleMap &yMap,
274  const QRectF &canvasRect ) const = 0;
275 
276  virtual QRectF boundingRect() const;
277 
278  virtual void getCanvasMarginHint(
279  const QwtScaleMap &xMap, const QwtScaleMap &yMap,
280  const QRectF &canvasRect,
281  double &left, double &top, double &right, double &bottom) const;
282 
283  virtual void updateScaleDiv(
284  const QwtScaleDiv&, const QwtScaleDiv& );
285 
286  virtual void updateLegend( const QwtPlotItem *,
287  const QList<QwtLegendData> & );
288 
289  QRectF scaleRect( const QwtScaleMap &, const QwtScaleMap & ) const;
290  QRectF paintRect( const QwtScaleMap &, const QwtScaleMap & ) const;
291 
292  virtual QList<QwtLegendData> legendData() const;
293 
294  virtual QwtGraphic legendIcon( int index, const QSizeF & ) const;
295 
296 protected:
297  QwtGraphic defaultIcon( const QBrush &, const QSizeF & ) const;
298 
299 private:
300  Q_DISABLE_COPY(QwtPlotItem)
301 
302  class PrivateData;
303  PrivateData *d_data;
304 };
305 
306 Q_DECLARE_OPERATORS_FOR_FLAGS( QwtPlotItem::ItemAttributes )
307 Q_DECLARE_OPERATORS_FOR_FLAGS( QwtPlotItem::ItemInterests )
308 Q_DECLARE_OPERATORS_FOR_FLAGS( QwtPlotItem::RenderHints )
309 
310 Q_DECLARE_METATYPE( QwtPlotItem * )
311 
312 #endif
For QwtPlotSpectrogram.
For QwtPlotGraphicItem, QwtPlotSvgItem.
For QwtPlotScaleItem.
Definition: qwt_plot_item.h:83
ItemAttribute
Plot Item Attributes.
QFlags< RenderHint > RenderHints
Render hints.
lu_byte right
Definition: lparser.c:1229
For QwtPlotTradingCurve.
#define QWT_EXPORT
Definition: qwt_global.h:38
For QwtPlotSpectroCurve.
Definition: qwt_plot_item.h:95
lu_byte left
Definition: lparser.c:1228
For QwtPlotMultiBarChart.
QFlags< ItemAttribute > ItemAttributes
Plot Item Attributes.
A class representing a scale division.
Definition: qwt_scale_div.h:33
A 2-D plotting widget.
Definition: qwt_plot.h:75
For QwtPlotHistogram.
QFlags< ItemInterest > ItemInterests
Plot Item Interests.
RttiValues
Runtime type information.
Definition: qwt_plot_item.h:74
For QwtPlotShapeItem.
For QwtPlotLegendItem.
Definition: qwt_plot_item.h:86
A class representing a text.
Definition: qwt_text.h:51
For QwtPlotZoneItem.
A paint device for scalable graphics.
Definition: qwt_graphic.h:75
RenderHint
Render hints.
For QwtPlotIntervalCurve.
Definition: qwt_plot_item.h:98
A scale map.
Definition: qwt_scale_map.h:26
int top(lua_State *L)
Definition: sol.hpp:10543
For QwtPlotTextLabel.
For QwtPlotMarker.
Definition: qwt_plot_item.h:89
For QwtPlotVectorField.
Base class for items on the plot canvas.
Definition: qwt_plot_item.h:65
ItemInterest
Plot Item Interests.
Attributes of an entry on a legend.
For QwtPlotBarChart.
For QwtPlotCurve.
Definition: qwt_plot_item.h:92


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