/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
* Qwt Widget Library
* Copyright (C) 1997 Josef Wilgen
* Copyright (C) 2002 Uwe Rathmann
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the Qwt License, Version 1.0
*****************************************************************************/
#ifndef QWT_SERIES_DATA_H
#define QWT_SERIES_DATA_H 1
#include "qwt_global.h"
#include "qwt_interval.h"
#include "qwt_point_3d.h"
#include "qwt_point_polar.h"
#include <qvector.h>
#include <qrect.h>
//! \brief A sample of the types (x1-x2, y) or (x, y1-y2)
class QWT_EXPORT QwtIntervalSample
{
public:
QwtIntervalSample();
QwtIntervalSample( double, const QwtInterval & );
QwtIntervalSample( double value, double min, double max );
bool operator==( const QwtIntervalSample & ) const;
bool operator!=( const QwtIntervalSample & ) const;
//! Value
double value;
//! Interval
QwtInterval interval;
};
/*!
Constructor
The value is set to 0.0, the interval is invalid
*/
inline QwtIntervalSample::QwtIntervalSample():
value( 0.0 )
{
}
//! Constructor
inline QwtIntervalSample::QwtIntervalSample(
double v, const QwtInterval &intv ):
value( v ),
interval( intv )
{
}
//! Constructor
inline QwtIntervalSample::QwtIntervalSample(
double v, double min, double max ):
value( v ),
interval( min, max )
{
}
//! Compare operator
inline bool QwtIntervalSample::operator==(
const QwtIntervalSample &other ) const
{
return value == other.value && interval == other.interval;
}
//! Compare operator
inline bool QwtIntervalSample::operator!=(
const QwtIntervalSample &other ) const
{
return !( *this == other );
}
//! \brief A sample of the types (x1...xn, y) or (x, y1..yn)
class QWT_EXPORT QwtSetSample
{
public:
QwtSetSample();
bool operator==( const QwtSetSample &other ) const;
bool operator!=( const QwtSetSample &other ) const;
//! value
double value;
//! Vector of values associated to value
QVector<double> set;
};
/*!
Constructor
The value is set to 0.0
*/
inline QwtSetSample::QwtSetSample():
value( 0.0 )
{
}
//! Compare operator
inline bool QwtSetSample::operator==( const QwtSetSample &other ) const
{
return value == other.value && set == other.set;
}
//! Compare operator
inline bool QwtSetSample::operator!=( const QwtSetSample &other ) const
{
return !( *this == other );
}
/*!
\brief Abstract interface for iterating over samples
Qwt offers several implementations of the QwtSeriesData API,
but in situations, where data of an application specific format
needs to be displayed, without having to copy it, it is recommended
to implement an individual data access.
*/
template <typename T>
class QwtSeriesData
{
public:
QwtSeriesData();
virtual ~QwtSeriesData();
//! \return Number of samples
virtual size_t size() const = 0;
/*!
Return a sample
\param i Index
\return Sample at position i
*/
virtual T sample( size_t i ) const = 0;
/*!
Calculate the bounding rect of all samples
The bounding rect is necessary for autoscaling and can be used
for a couple of painting optimizations.
qwtBoundingRect(...) offers slow implementations iterating
over the samples. For large sets it is recommended to implement
something faster f.e. by caching the bounding rect.
*/
virtual QRectF boundingRect() const = 0;
virtual void setRectOfInterest( const QRectF & );
protected:
//! Can be used to cache a calculated bounding rectangle
mutable QRectF d_boundingRect;
private:
QwtSeriesData<T> &operator=( const QwtSeriesData<T> & );
};
//! Constructor
template <typename T>
QwtSeriesData<T>::QwtSeriesData():
d_boundingRect( 0.0, 0.0, -1.0, -1.0 )
{
}
//! Destructor
template <typename T>
QwtSeriesData<T>::~QwtSeriesData()
{
}
/*!
Set a the "rect of interest"
QwtPlotSeriesItem defines the current area of the plot canvas
as "rect of interest" ( QwtPlotSeriesItem::updateScaleDiv() ).
It can be used to implement different levels of details.
The default implementation does nothing.
*/
template <typename T>
void QwtSeriesData<T>::setRectOfInterest( const QRectF & )
{
}
/*!
\brief Template class for data, that is organized as QVector
QVector uses implicit data sharing and can be
passed around as argument efficiently.
*/
template <typename T>
class QwtArraySeriesData: public QwtSeriesData<T>
{
public:
QwtArraySeriesData();
QwtArraySeriesData( const QVector<T> & );
void setSamples( const QVector<T> & );
const QVector<T> samples() const;
virtual size_t size() const;
virtual T sample( size_t ) const;
protected:
//! Vector of samples
QVector<T> d_samples;
};
//! Constructor
template <typename T>
QwtArraySeriesData<T>::QwtArraySeriesData()
{
}
/*!
Constructor
\param samples Array of samples
*/
template <typename T>
QwtArraySeriesData<T>::QwtArraySeriesData( const QVector<T> &samples ):
d_samples( samples )
{
}
/*!
Assign an array of samples
\param samples Array of samples
*/
template <typename T>
void QwtArraySeriesData<T>::setSamples( const QVector<T> &samples )
{
QwtSeriesData<T>::d_boundingRect = QRectF( 0.0, 0.0, -1.0, -1.0 );
d_samples = samples;
}
//! \return Array of samples
template <typename T>
const QVector<T> QwtArraySeriesData<T>::samples() const
{
return d_samples;
}
//! \return Number of samples
template <typename T>
size_t QwtArraySeriesData<T>::size() const
{
return d_samples.size();
}
/*!
Return a sample
\param i Index
\return Sample at position i
*/
template <typename T>
T QwtArraySeriesData<T>::sample( size_t i ) const
{
return d_samples[i];
}
//! Interface for iterating over an array of points
class QWT_EXPORT QwtPointSeriesData: public QwtArraySeriesData<QPointF>
{
public:
QwtPointSeriesData(
const QVector<QPointF> & = QVector<QPointF>() );
virtual QRectF boundingRect() const;
};
//! Interface for iterating over an array of 3D points
class QWT_EXPORT QwtPoint3DSeriesData: public QwtArraySeriesData<QwtPoint3D>
{
public:
QwtPoint3DSeriesData(
const QVector<QwtPoint3D> & = QVector<QwtPoint3D>() );
virtual QRectF boundingRect() const;
};
//! Interface for iterating over an array of intervals
class QWT_EXPORT QwtIntervalSeriesData: public QwtArraySeriesData<QwtIntervalSample>
{
public:
QwtIntervalSeriesData(
const QVector<QwtIntervalSample> & = QVector<QwtIntervalSample>() );
virtual QRectF boundingRect() const;
};
//! Interface for iterating over an array of samples
class QWT_EXPORT QwtSetSeriesData: public QwtArraySeriesData<QwtSetSample>
{
public:
QwtSetSeriesData(
const QVector<QwtSetSample> & = QVector<QwtSetSample>() );
virtual QRectF boundingRect() const;
};
/*!
\brief Interface for iterating over two QVector<double> objects.
*/
class QWT_EXPORT QwtPointArrayData: public QwtSeriesData<QPointF>
{
public:
QwtPointArrayData( const QVector<double> &x, const QVector<double> &y );
QwtPointArrayData( const double *x, const double *y, size_t size );
virtual QRectF boundingRect() const;
virtual size_t size() const;
virtual QPointF sample( size_t i ) const;
const QVector<double> &xData() const;
const QVector<double> &yData() const;
private:
QVector<double> d_x;
QVector<double> d_y;
};
/*!
\brief Data class containing two pointers to memory blocks of doubles.
*/
class QWT_EXPORT QwtCPointerData: public QwtSeri
没有合适的资源?快使用搜索试试~ 我知道了~
Qwt-6.0.0-sdk.zip
共917个文件
html:388个
png:166个
md5:133个
需积分: 1 0 下载量 187 浏览量
2024-08-11
10:39:17
上传
评论
收藏 8.59MB ZIP 举报
温馨提示
笔者在Windows 10系统下使用 Visual Studio 2017预编译的二进制开发包,方便大家下载学习使用
资源推荐
资源详情
资源评论
收起资源包目录
Qwt-6.0.0-sdk.zip (917个子文件)
doxygen.css 12KB
tabs.css 1KB
qwtd.dll 2.54MB
qwtmathmld.dll 1.39MB
qwt.dll 864KB
qwtmathml.dll 329KB
qwt_series_data.h 11KB
qwt_plot_curve.h 10KB
qwt_picker.h 9KB
qwt_plot.h 8KB
qwt_interval.h 7KB
qwt_scale_engine.h 6KB
qwt_text.h 6KB
qwt_dial.h 6KB
qwt_thermo.h 5KB
qwt_event_pattern.h 5KB
qwt_abstract_slider.h 5KB
qwt_plot_item.h 5KB
qwt_color_map.h 5KB
qwt_plot_seriesitem.h 5KB
qwt_picker_machine.h 5KB
qwt_scale_map.h 5KB
qwt_text_engine.h 5KB
qwt_plot_canvas.h 5KB
qwt_plot_rasteritem.h 5KB
qwt_painter.h 5KB
qwt_counter.h 5KB
qwt_knob.h 4KB
qwt_point_polar.h 4KB
qwt_dial_needle.h 4KB
qwt_plot_histogram.h 4KB
qwt_plot_renderer.h 4KB
qwt_point_3d.h 4KB
qwt_math.h 4KB
qwt_slider.h 4KB
qwt_plot_rescaler.h 4KB
qwt_column_symbol.h 4KB
qwt_plot_intervalcurve.h 4KB
qwt_abstract_scale_draw.h 4KB
qwt_scale_widget.h 4KB
qwt_symbol.h 3KB
qwt_plot_spectrogram.h 3KB
qwt_curve_fitter.h 3KB
qwt_plot_marker.h 3KB
qwt_plot_directpainter.h 3KB
qwt_scale_draw.h 3KB
qwt_plot_zoomer.h 3KB
qwt_plot_picker.h 3KB
qwt_scale_div.h 3KB
qwt_panner.h 3KB
qwt_plot_layout.h 3KB
qwt_raster_data.h 3KB
qwt_null_paintdevice.h 3KB
qwt_plot_scaleitem.h 3KB
qwt_wheel.h 2KB
qwt_spline.h 2KB
qwt_legend.h 2KB
qwt_analog_clock.h 2KB
qwt_dyngrid_layout.h 2KB
qwt_magnifier.h 2KB
qwt_compass_rose.h 2KB
qwt_interval_symbol.h 2KB
qwt_plot_grid.h 2KB
qwt_double_range.h 2KB
qwt_plot_spectrocurve.h 2KB
qwt_round_scale_draw.h 2KB
qwt_matrix_raster_data.h 2KB
qwt_legend_item.h 2KB
qwt_abstract_scale.h 2KB
qwt_text_label.h 2KB
qwt_compass.h 2KB
qwt_mathml_text_engine.h 2KB
qwt_plot_svgitem.h 2KB
qwt_legend_itemmanager.h 2KB
qwt_plot_panner.h 2KB
qwt_plot_dict.h 2KB
qwt_plot_magnifier.h 1KB
qwt_arrow_button.h 1KB
qwt_system_clock.h 1KB
qwt_global.h 1KB
qwt_sampling_thread.h 1KB
qwt_compat.h 1KB
qwt_clipper.h 991B
qwt.h 533B
class_qwt_plot.html 105KB
class_qwt_plot_curve.html 100KB
class_qwt_picker.html 100KB
class_qwt_dial.html 73KB
functions_0x73.html 63KB
class_qwt_scale_widget.html 62KB
class_qwt_plot_item.html 62KB
functions_func_0x73.html 58KB
class_qwt_thermo.html 58KB
class_qwt_text.html 56KB
class_qwt_plot_spectrogram.html 54KB
class_qwt_plot_renderer.html 51KB
class_qwt_plot_histogram.html 49KB
class_qwt_plot_rescaler.html 48KB
class_qwt_painter.html 48KB
class_qwt_abstract_slider.html 47KB
共 917 条
- 1
- 2
- 3
- 4
- 5
- 6
- 10
资源评论
刘亿辰
- 粉丝: 101
- 资源: 122
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功