Synthetic point data. More...
#include <qwt_point_data.h>
Public Member Functions | |
virtual QRectF | boundingRect () const |
Calculate the bounding rectangle. More... | |
QwtInterval | interval () const |
QwtSyntheticPointData (size_t size, const QwtInterval &=QwtInterval()) | |
QRectF | rectOfInterest () const |
virtual QPointF | sample (size_t i) const |
void | setInterval (const QwtInterval &) |
virtual void | setRectOfInterest (const QRectF &) |
void | setSize (size_t size) |
virtual size_t | size () const |
virtual double | x (uint index) const |
virtual double | y (double x) const =0 |
Public Member Functions inherited from QwtSeriesData< QPointF > | |
QwtSeriesData () | |
Constructor. More... | |
virtual | ~QwtSeriesData () |
Destructor. More... | |
Private Attributes | |
QwtInterval | d_interval |
QwtInterval | d_intervalOfInterest |
QRectF | d_rectOfInterest |
size_t | d_size |
Additional Inherited Members | |
Protected Attributes inherited from QwtSeriesData< QPointF > | |
QRectF | d_boundingRect |
Can be used to cache a calculated bounding rectangle. More... | |
Synthetic point data.
QwtSyntheticPointData provides a fixed number of points for an interval. The points are calculated in equidistant steps in x-direction.
If the interval is invalid, the points are calculated for the "rectangle of interest", what normally is the displayed area on the plot canvas. In this mode you get different levels of detail, when zooming in/out.
The following example shows how to implement a sinus curve.
Definition at line 112 of file qwt_point_data.h.
QwtSyntheticPointData::QwtSyntheticPointData | ( | size_t | size, |
const QwtInterval & | interval = QwtInterval() |
||
) |
Constructor
size | Number of points |
interval | Bounding interval for the points |
Definition at line 166 of file qwt_point_data.cpp.
|
virtual |
Calculate the bounding rectangle.
This implementation iterates over all points, what could often be implemented much faster using the characteristics of the series. When there are many points it is recommended to overload and reimplement this method using the characteristics of the series ( if possible ).
Implements QwtSeriesData< QPointF >.
Definition at line 251 of file qwt_point_data.cpp.
QwtInterval QwtSyntheticPointData::interval | ( | ) | const |
Definition at line 208 of file qwt_point_data.cpp.
QRectF QwtSyntheticPointData::rectOfInterest | ( | ) | const |
Definition at line 235 of file qwt_point_data.cpp.
|
virtual |
Calculate the point from an index
index | Index |
Implements QwtSeriesData< QPointF >.
Definition at line 271 of file qwt_point_data.cpp.
void QwtSyntheticPointData::setInterval | ( | const QwtInterval & | interval | ) |
Set the bounding interval
interval | Interval |
Definition at line 199 of file qwt_point_data.cpp.
|
virtual |
Set a the "rectangle of interest"
QwtPlotSeriesItem defines the current area of the plot canvas as "rect of interest" ( QwtPlotSeriesItem::updateScaleDiv() ).
If interval().isValid() == false the x values are calculated in the interval rect.left() -> rect.right().
Reimplemented from QwtSeriesData< QPointF >.
Definition at line 224 of file qwt_point_data.cpp.
void QwtSyntheticPointData::setSize | ( | size_t | size | ) |
Change the number of points
size | Number of points |
Definition at line 179 of file qwt_point_data.cpp.
|
virtual |
Implements QwtSeriesData< QPointF >.
Definition at line 188 of file qwt_point_data.cpp.
|
virtual |
Calculate a x-value from an index
x values are calculated by dividing an interval into equidistant steps. If !interval().isValid() the interval is calculated from the "rectangle of interest".
index | Index of the requested point |
Definition at line 294 of file qwt_point_data.cpp.
|
pure virtual |
Calculate a y value for a x value
x | x value |
|
private |
Definition at line 141 of file qwt_point_data.h.
|
private |
Definition at line 143 of file qwt_point_data.h.
|
private |
Definition at line 142 of file qwt_point_data.h.
|
private |
Definition at line 140 of file qwt_point_data.h.