QWT API (中文) 7.0.1
Qt绘图库 - 中文API文档
载入中...
搜索中...
未找到
qwt_plot_rasteritem.h
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 * Modified by ChenZongYan in 2024 <czy.t@163.com>
10 * Summary of major modifications (see ChangeLog.md for full history):
11 * 1. CMake build system & C++11 throughout.
12 * 2. Core panner/ zoomer refactored:
13 * - QwtPanner → QwtCachePanner (pixmap-cache version)
14 * - New real-time QwtPlotPanner derived from QwtPicker.
15 * 3. Zoomer supports multi-axis.
16 * 4. Parasite-plot framework:
17 * - QwtFigure, QwtPlotParasiteLayout, QwtPlotTransparentCanvas,
18 * - QwtPlotScaleEventDispatcher, built-in pan/zoom on axis.
19 * 5. New picker: QwtPlotSeriesDataPicker (works with date axis).
20 * 6. Raster & color-map extensions:
21 * - QwtGridRasterData (2-D table + interpolation)
22 * - QwtLinearColorMap::stopColors(), stopPos() API rename.
23 * 7. Bar-chart: expose pen/brush control.
24 * 8. Amalgamated build: single QwtPlot.h / QwtPlot.cpp pair in src-amalgamate.
25 *****************************************************************************/
26
27#ifndef QWT_PLOT_RASTERITEM_H
28#define QWT_PLOT_RASTERITEM_H
29
30#include "qwt_global.h"
31#include "qwt_plot_item.h"
32
33#include <qstring.h>
34
35class QwtInterval;
36
70class QWT_EXPORT QwtPlotRasterItem : public QwtPlotItem
71{
72 public:
85 {
96
114 PaintCache
115 };
116
131 {
153 PaintInDeviceResolution = 1
154 };
155
156 Q_DECLARE_FLAGS( PaintAttributes, PaintAttribute )
157
158 // Constructor
159 explicit QwtPlotRasterItem( const QString& title = QString() );
160 // Constructor with title
161 explicit QwtPlotRasterItem( const QwtText& title );
162 // Destructor
163 virtual ~QwtPlotRasterItem();
164
165 // Set a paint attribute
166 void setPaintAttribute( PaintAttribute, bool on = true );
167 // Test a paint attribute
168 bool testPaintAttribute( PaintAttribute ) const;
169
170 // Set the alpha value
171 void setAlpha( int alpha );
172 // Get the alpha value
173 int alpha() const;
174
175 // Set the cache policy
176 void setCachePolicy( CachePolicy );
177 // Get the cache policy
178 CachePolicy cachePolicy() const;
179
180 // Invalidate the cache
181 void invalidateCache();
182
183 // Draw the raster item
184 virtual void draw( QPainter*,
185 const QwtScaleMap& xMap, const QwtScaleMap& yMap,
186 const QRectF& canvasRect ) const override;
187
188 // Get the pixel hint
189 virtual QRectF pixelHint( const QRectF& ) const;
190
191 // Get the interval for a specific axis
192 virtual QwtInterval interval(Qt::Axis) const;
193 // Get the bounding rectangle
194 virtual QRectF boundingRect() const override;
195
196 protected:
228 virtual QImage renderImage( const QwtScaleMap& xMap,
229 const QwtScaleMap& yMap, const QRectF& area,
230 const QSize& imageSize ) const = 0;
231
233 virtual QwtScaleMap imageMap( Qt::Orientation,
234 const QwtScaleMap& map, const QRectF& area,
235 const QSize& imageSize, double pixelSize) const;
236
237 private:
238 explicit QwtPlotRasterItem( const QwtPlotRasterItem& );
239 QwtPlotRasterItem& operator=( const QwtPlotRasterItem& );
240
242 void init();
243
245 QImage compose( const QwtScaleMap&, const QwtScaleMap&,
246 const QRectF& imageArea, const QRectF& paintRect,
247 const QSize& imageSize, bool doCache) const;
248
249
250 class PrivateData;
251 PrivateData* m_data;
252};
253
254Q_DECLARE_OPERATORS_FOR_FLAGS( QwtPlotRasterItem::PaintAttributes )
255
256#endif
表示区间的类
Definition qwt_interval.h:45
绘图画布上项目的基类
Definition qwt_plot_item.h:119
virtual void draw(QPainter *painter, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect) const =0
绘制项目
virtual QRectF boundingRect() const
Get the bounding rectangle
Definition qwt_plot_item.cpp:883
显示栅格数据的类
Definition qwt_plot_rasteritem.h:71
virtual QImage renderImage(const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &area, const QSize &imageSize) const =0
渲染图像
PaintAttribute
绘制属性
Definition qwt_plot_rasteritem.h:131
CachePolicy
缓存策略
Definition qwt_plot_rasteritem.h:85
@ NoCache
Definition qwt_plot_rasteritem.h:95
刻度映射
Definition qwt_scale_map.h:52
表示文本的类
Definition qwt_text.h:93