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 "qwt_text.h"
15 #include "qwt_legend_data.h"
16 #include "qwt_graphic.h"
17 #include <qrect.h>
18 #include <qlist.h>
19 #include <qmetatype.h>
20 
21 class QPainter;
22 class QwtScaleMap;
23 class QwtScaleDiv;
24 class QwtPlot;
25 
65 {
66 public:
74  {
76  Rtti_PlotItem = 0,
77 
80 
83 
86 
89 
92 
95 
98 
101 
104 
107 
110 
113 
116 
119 
122 
125 
130  Rtti_PlotUserItem = 1000
131  };
132 
143  {
145  Legend = 0x01,
146 
152  AutoScale = 0x02,
153 
159  Margins = 0x04
160  };
161 
163  typedef QFlags<ItemAttribute> ItemAttributes;
164 
176  {
181  ScaleInterest = 0x01,
182 
193  LegendInterest = 0x02
194  };
195 
197  typedef QFlags<ItemInterest> ItemInterests;
198 
201  {
203  RenderAntialiased = 0x1
204  };
205 
207  typedef QFlags<RenderHint> RenderHints;
208 
209  explicit QwtPlotItem( const QwtText &title = QwtText() );
210  virtual ~QwtPlotItem();
211 
212  void attach( QwtPlot *plot );
213  void detach();
214 
215  QwtPlot *plot() const;
216 
217  void setTitle( const QString &title );
218  void setTitle( const QwtText &title );
219  const QwtText &title() const;
220 
221  virtual int rtti() const;
222 
223  void setItemAttribute( ItemAttribute, bool on = true );
224  bool testItemAttribute( ItemAttribute ) const;
225 
226  void setItemInterest( ItemInterest, bool on = true );
227  bool testItemInterest( ItemInterest ) const;
228 
229  void setRenderHint( RenderHint, bool on = true );
230  bool testRenderHint( RenderHint ) const;
231 
232  void setRenderThreadCount( uint numThreads );
233  uint renderThreadCount() const;
234 
235  void setLegendIconSize( const QSize & );
236  QSize legendIconSize() const;
237 
238  double z() const;
239  void setZ( double z );
240 
241  void show();
242  void hide();
243  virtual void setVisible( bool );
244  bool isVisible () const;
245 
246  void setAxes( int xAxis, int yAxis );
247 
248  void setXAxis( int axis );
249  int xAxis() const;
250 
251  void setYAxis( int axis );
252  int yAxis() const;
253 
254  virtual void itemChanged();
255  virtual void legendChanged();
256 
265  virtual void draw( QPainter *painter,
266  const QwtScaleMap &xMap, const QwtScaleMap &yMap,
267  const QRectF &canvasRect ) const = 0;
268 
269  virtual QRectF boundingRect() const;
270 
271  virtual void getCanvasMarginHint(
272  const QwtScaleMap &xMap, const QwtScaleMap &yMap,
273  const QRectF &canvasSize,
274  double &left, double &top, double &right, double &bottom) const;
275 
276  virtual void updateScaleDiv(
277  const QwtScaleDiv&, const QwtScaleDiv& );
278 
279  virtual void updateLegend( const QwtPlotItem *,
280  const QList<QwtLegendData> & );
281 
282  QRectF scaleRect( const QwtScaleMap &, const QwtScaleMap & ) const;
283  QRectF paintRect( const QwtScaleMap &, const QwtScaleMap & ) const;
284 
285  virtual QList<QwtLegendData> legendData() const;
286 
287  virtual QwtGraphic legendIcon( int index, const QSizeF & ) const;
288 
289 protected:
290  QwtGraphic defaultIcon( const QBrush &, const QSizeF & ) const;
291 
292 private:
293  Q_DISABLE_COPY(QwtPlotItem)
294 
295  class PrivateData;
296  PrivateData *d_data;
297 };
298 
299 Q_DECLARE_OPERATORS_FOR_FLAGS( QwtPlotItem::ItemAttributes )
300 Q_DECLARE_OPERATORS_FOR_FLAGS( QwtPlotItem::ItemInterests )
301 Q_DECLARE_OPERATORS_FOR_FLAGS( QwtPlotItem::RenderHints )
302 
303 Q_DECLARE_METATYPE( QwtPlotItem * )
304 
305 #endif
For QwtPlotSpectrogram.
For QwtPlotScaleItem.
Definition: qwt_plot_item.h:82
ItemAttribute
Plot Item Attributes.
QFlags< RenderHint > RenderHints
Render hints.
For QwtPlotTradingCurve.
#define QWT_EXPORT
Definition: qwt_global.h:38
For QwtPlotSpectroCurve.
Definition: qwt_plot_item.h:94
TFSIMD_FORCE_INLINE void setZ(tfScalar z)
For QwtPlotMultiBarChart.
QFlags< ItemAttribute > ItemAttributes
Plot Item Attributes.
A class representing a scale division.
Definition: qwt_scale_div.h:36
A 2-D plotting widget.
Definition: qwt_plot.h:74
For QwtPlotHistogram.
QFlags< ItemInterest > ItemInterests
Plot Item Interests.
For QwtPlotSvgItem.
RttiValues
Runtime type information.
Definition: qwt_plot_item.h:73
For QwtPlotShapeItem.
For QwtPlotLegendItem.
Definition: qwt_plot_item.h:85
A class representing a text.
Definition: qwt_text.h:51
For QwtPlotZoneItem.
A paint device for scalable graphics.
Definition: qwt_graphic.h:74
RenderHint
Render hints.
For QwtPlotIntervalCurve.
Definition: qwt_plot_item.h:97
A scale map.
Definition: qwt_scale_map.h:30
TFSIMD_FORCE_INLINE const tfScalar & z() const
For QwtPlotTextLabel.
For QwtPlotMarker.
Definition: qwt_plot_item.h:88
Base class for items on the plot canvas.
Definition: qwt_plot_item.h:64
ItemInterest
Plot Item Interests.
For QwtPlotBarChart.
For QwtPlotCurve.
Definition: qwt_plot_item.h:91


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