QWT API (中文) 7.3.0
Qt绘图库 - 中文API文档
载入中...
搜索中...
未找到
静态 Public 成员函数 | 所有成员列表
QwtPlotDataAccess类 参考

Utility class for reading and writing sample data from QwtPlotItem instances 更多...

#include <qwt_plot_data_access.h>

静态 Public 成员函数

static QVector< QPointF > xySamples (const QwtPlotItem *item)
 Extract XY samples from a plot item
 
static void xySamples (const QwtPlotItem *item, QVector< double > &x, QVector< double > &y)
 Extract XY samples into separate x and y vectors
 
static bool setXYSamples (QwtPlotItem *item, const QVector< QPointF > &data)
 Set XY samples on a plot item
 
static bool setXYSamples (QwtPlotItem *item, const QVector< double > &x, const QVector< double > &y)
 Set XY samples from separate x and y vectors
 
static QVector< QwtIntervalSampleintervalSamples (const QwtPlotItem *item)
 Extract interval samples from a plot item
 
static bool setIntervalSamples (QwtPlotItem *item, const QVector< QwtIntervalSample > &data)
 Set interval samples on a plot item
 
static QVector< QwtPoint3DxyzSamples (const QwtPlotItem *item)
 Extract 3D point samples from a plot item
 
static bool setXyzSamples (QwtPlotItem *item, const QVector< QwtPoint3D > &data)
 Set 3D point samples on a plot item
 
static QVector< QwtOHLCSampleohlcSamples (const QwtPlotItem *item)
 Extract OHLC samples from a plot item
 
static bool setOhlcSamples (QwtPlotItem *item, const QVector< QwtOHLCSample > &data)
 Set OHLC samples on a plot item
 
static QVector< QwtSetSamplesetSamples (const QwtPlotItem *item)
 Extract set samples from a plot item
 
static bool setSetSamples (QwtPlotItem *item, const QVector< QwtSetSample > &data)
 Set set samples on a plot item
 
static QVector< QwtVectorFieldSamplevectorFieldSamples (const QwtPlotItem *item)
 Extract vector field samples from a plot item
 
static bool setVectorFieldSamples (QwtPlotItem *item, const QVector< QwtVectorFieldSample > &data)
 Set vector field samples on a plot item
 
static QVector< QwtBoxSampleboxSamples (const QwtPlotItem *item)
 Extract box samples from a plot item
 
static bool setBoxSamples (QwtPlotItem *item, const QVector< QwtBoxSample > &data)
 Set box samples on a plot item
 
template<typename T >
static QVector< T > samples (const QwtSeriesStore< T > *store)
 
template<typename T >
static QVector< T > samples (const QwtSeriesStore< T > *store, int from, int to)
 
static QVector< QPointF > xySamplesInRange (const QwtPlotItem *item, const QRectF &range)
 Extract XY samples within a rectangular range
 
static QVector< QPointF > xySamplesInRange (const QwtPlotItem *item, const QPainterPath &range)
 Extract XY samples within a path range
 
static int removeSamplesInRange (QwtPlotItem *item, const QRectF &range)
 Remove XY samples within a rectangular range
 
static int removeSamplesInRange (QwtPlotItem *item, const QPainterPath &range)
 Remove XY samples within a path range
 

详细描述

Utility class for reading and writing sample data from QwtPlotItem instances

QwtPlotDataAccess provides type-safe static methods to extract or set sample data from any QwtPlotItem. The methods use the item's rtti to dispatch to the correct underlying QwtSeriesStore type.

Supported data types:

QwtPlotItem* item = ...;
QVector<QPointF> data = Qwt::QwtPlotDataAccess::xySamples(item);
if (!data.isEmpty()) {
qDebug() << "First point:" << data.first();
}
Definition qwt_clipper.h:41
Base class for items on the plot canvas
Definition qwt_plot_item.h:85
参见
QwtPlotItemInfo, QwtSeriesStore

成员函数说明

◆ boxSamples()

QVector< QwtBoxSample > QwtPlotDataAccess::boxSamples ( const QwtPlotItem item)
static

Extract box samples from a plot item

参数
itemPlot item (must be QwtPlotBoxChart)
返回
Vector of QwtBoxSample

◆ intervalSamples()

QVector< QwtIntervalSample > QwtPlotDataAccess::intervalSamples ( const QwtPlotItem item)
static

Extract interval samples from a plot item

参数
itemPlot item (must be QwtPlotIntervalCurve or QwtPlotHistogram)
返回
Vector of QwtIntervalSample, empty if not supported

◆ ohlcSamples()

QVector< QwtOHLCSample > QwtPlotDataAccess::ohlcSamples ( const QwtPlotItem item)
static

Extract OHLC samples from a plot item

参数
itemPlot item (must be QwtPlotTradingCurve)
返回
Vector of QwtOHLCSample

◆ removeSamplesInRange() [1/2]

int QwtPlotDataAccess::removeSamplesInRange ( QwtPlotItem item,
const QPainterPath &  range 
)
static

Remove XY samples within a path range

参数
itemPlot item (must be QwtPlotCurve or QwtPlotBarChart)
rangePath range in data coordinates
返回
Number of samples removed

◆ removeSamplesInRange() [2/2]

int QwtPlotDataAccess::removeSamplesInRange ( QwtPlotItem item,
const QRectF &  range 
)
static

Remove XY samples within a rectangular range

参数
itemPlot item (must be QwtPlotCurve or QwtPlotBarChart)
rangeRectangular range in data coordinates
返回
Number of samples removed

◆ setBoxSamples()

bool QwtPlotDataAccess::setBoxSamples ( QwtPlotItem item,
const QVector< QwtBoxSample > &  data 
)
static

Set box samples on a plot item

参数
itemPlot item (must be QwtPlotBoxChart)
dataBox sample data
返回
true if successful

◆ setIntervalSamples()

bool QwtPlotDataAccess::setIntervalSamples ( QwtPlotItem item,
const QVector< QwtIntervalSample > &  data 
)
static

Set interval samples on a plot item

参数
itemPlot item (must be QwtPlotIntervalCurve or QwtPlotHistogram)
dataInterval sample data
返回
true if successful

◆ setOhlcSamples()

bool QwtPlotDataAccess::setOhlcSamples ( QwtPlotItem item,
const QVector< QwtOHLCSample > &  data 
)
static

Set OHLC samples on a plot item

参数
itemPlot item (must be QwtPlotTradingCurve)
dataOHLC sample data
返回
true if successful

◆ setSamples()

QVector< QwtSetSample > QwtPlotDataAccess::setSamples ( const QwtPlotItem item)
static

Extract set samples from a plot item

参数
itemPlot item (must be QwtPlotMultiBarChart)
返回
Vector of QwtSetSample

◆ setSetSamples()

bool QwtPlotDataAccess::setSetSamples ( QwtPlotItem item,
const QVector< QwtSetSample > &  data 
)
static

Set set samples on a plot item

参数
itemPlot item (must be QwtPlotMultiBarChart)
dataSet sample data
返回
true if successful

◆ setVectorFieldSamples()

bool QwtPlotDataAccess::setVectorFieldSamples ( QwtPlotItem item,
const QVector< QwtVectorFieldSample > &  data 
)
static

Set vector field samples on a plot item

参数
itemPlot item (must be QwtPlotVectorField)
dataVector field sample data
返回
true if successful

◆ setXYSamples() [1/2]

bool QwtPlotDataAccess::setXYSamples ( QwtPlotItem item,
const QVector< double > &  x,
const QVector< double > &  y 
)
static

Set XY samples from separate x and y vectors

参数
itemPlot item (must be QwtPlotCurve)
xX coordinate vector
yY coordinate vector
返回
true if successful, false if item type is not supported
注解
Only QwtPlotCurve supports separate x/y vectors; QwtPlotBarChart is not supported here

◆ setXYSamples() [2/2]

bool QwtPlotDataAccess::setXYSamples ( QwtPlotItem item,
const QVector< QPointF > &  data 
)
static

Set XY samples on a plot item

参数
itemPlot item (must be QwtPlotCurve or QwtPlotBarChart)
dataSample data to set
返回
true if successful, false if item type is not supported

◆ setXyzSamples()

bool QwtPlotDataAccess::setXyzSamples ( QwtPlotItem item,
const QVector< QwtPoint3D > &  data 
)
static

Set 3D point samples on a plot item

参数
itemPlot item (must be QwtPlotSpectroCurve)
data3D point data
返回
true if successful

◆ vectorFieldSamples()

QVector< QwtVectorFieldSample > QwtPlotDataAccess::vectorFieldSamples ( const QwtPlotItem item)
static

Extract vector field samples from a plot item

参数
itemPlot item (must be QwtPlotVectorField)
返回
Vector of QwtVectorFieldSample

◆ xySamples() [1/2]

QVector< QPointF > QwtPlotDataAccess::xySamples ( const QwtPlotItem item)
static

Extract XY samples from a plot item

参数
itemPlot item (must be QwtPlotCurve or QwtPlotBarChart)
返回
Vector of QPointF samples, empty if item type is not supported

◆ xySamples() [2/2]

void QwtPlotDataAccess::xySamples ( const QwtPlotItem item,
QVector< double > &  x,
QVector< double > &  y 
)
static

Extract XY samples into separate x and y vectors

参数
itemPlot item (must be QwtPlotCurve or QwtPlotBarChart)
[out]xOutput vector for x coordinates
[out]yOutput vector for y coordinates

◆ xySamplesInRange() [1/2]

QVector< QPointF > QwtPlotDataAccess::xySamplesInRange ( const QwtPlotItem item,
const QPainterPath &  range 
)
static

Extract XY samples within a path range

参数
itemPlot item (must be QwtPlotCurve or QwtPlotBarChart)
rangePath range in data coordinates
返回
Filtered samples that fall within the path

◆ xySamplesInRange() [2/2]

QVector< QPointF > QwtPlotDataAccess::xySamplesInRange ( const QwtPlotItem item,
const QRectF &  range 
)
static

Extract XY samples within a rectangular range

参数
itemPlot item (must be QwtPlotCurve or QwtPlotBarChart)
rangeRectangular range in data coordinates
返回
Filtered samples that fall within the range

◆ xyzSamples()

QVector< QwtPoint3D > QwtPlotDataAccess::xyzSamples ( const QwtPlotItem item)
static

Extract 3D point samples from a plot item

参数
itemPlot item (must be QwtPlotSpectroCurve)
返回
Vector of QwtPoint3D samples

该类的文档由以下文件生成: