310 lines
6.7 KiB
Groff
310 lines
6.7 KiB
Groff
.TH "QwtSyntheticPointData" 3 "Sun Jul 18 2021" "Version 6.2.0" "Qwt User's Guide" \" -*- nroff -*-
|
|
.ad l
|
|
.nh
|
|
.SH NAME
|
|
QwtSyntheticPointData \- Synthetic point data\&.
|
|
|
|
.SH SYNOPSIS
|
|
.br
|
|
.PP
|
|
.PP
|
|
\fC#include <qwt_point_data\&.h>\fP
|
|
.PP
|
|
Inherits \fBQwtPointSeriesData\fP\&.
|
|
.SS "Public Member Functions"
|
|
|
|
.in +1c
|
|
.ti -1c
|
|
.RI "\fBQwtSyntheticPointData\fP (size_t \fBsize\fP, const \fBQwtInterval\fP &=\fBQwtInterval\fP())"
|
|
.br
|
|
.ti -1c
|
|
.RI "void \fBsetSize\fP (size_t \fBsize\fP)"
|
|
.br
|
|
.ti -1c
|
|
.RI "virtual size_t \fBsize\fP () const override"
|
|
.br
|
|
.ti -1c
|
|
.RI "void \fBsetInterval\fP (const \fBQwtInterval\fP &)"
|
|
.br
|
|
.ti -1c
|
|
.RI "\fBQwtInterval\fP \fBinterval\fP () const"
|
|
.br
|
|
.ti -1c
|
|
.RI "virtual QRectF \fBboundingRect\fP () const override"
|
|
.br
|
|
.RI "Calculate the bounding rectangle\&. "
|
|
.ti -1c
|
|
.RI "virtual QPointF \fBsample\fP (size_t index) const override"
|
|
.br
|
|
.ti -1c
|
|
.RI "virtual double \fBy\fP (double \fBx\fP) const =0"
|
|
.br
|
|
.ti -1c
|
|
.RI "virtual double \fBx\fP (uint index) const"
|
|
.br
|
|
.ti -1c
|
|
.RI "virtual void \fBsetRectOfInterest\fP (const QRectF &) override"
|
|
.br
|
|
.ti -1c
|
|
.RI "QRectF \fBrectOfInterest\fP () const"
|
|
.br
|
|
.in -1c
|
|
.SS "Additional Inherited Members"
|
|
.SH "Detailed Description"
|
|
.PP
|
|
Synthetic point data\&.
|
|
|
|
\fBQwtSyntheticPointData\fP provides a fixed number of points for an interval\&. The points are calculated in equidistant steps in x-direction\&.
|
|
.PP
|
|
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\&.
|
|
.PP
|
|
\fBExample\fP
|
|
.RS 4
|
|
|
|
.RE
|
|
.PP
|
|
The following example shows how to implement a sinus curve\&.
|
|
.PP
|
|
.PP
|
|
.nf
|
|
#include <cmath>
|
|
#include <qwt_series_data\&.h>
|
|
#include <qwt_plot_curve\&.h>
|
|
#include <qwt_plot\&.h>
|
|
#include <qapplication\&.h>
|
|
|
|
class SinusData: public QwtSyntheticPointData
|
|
{
|
|
public:
|
|
SinusData():
|
|
QwtSyntheticPointData( 100 )
|
|
{
|
|
}
|
|
|
|
virtual double y( double x ) const
|
|
{
|
|
return qSin( x );
|
|
}
|
|
};
|
|
|
|
int main(int argc, char **argv)
|
|
{
|
|
QApplication a( argc, argv );
|
|
|
|
QwtPlot plot;
|
|
plot\&.setAxisScale( QwtAxis::XBottom, 0\&.0, 10\&.0 );
|
|
plot\&.setAxisScale( QwtAxis::YLeft, -1\&.0, 1\&.0 );
|
|
|
|
QwtPlotCurve *curve = new QwtPlotCurve( "y = sin(x)" );
|
|
curve->setData( new SinusData() );
|
|
curve->attach( &plot );
|
|
|
|
plot\&.show();
|
|
return a\&.exec();
|
|
}
|
|
.fi
|
|
.PP
|
|
|
|
.PP
|
|
Definition at line 157 of file qwt_point_data\&.h\&.
|
|
.SH "Constructor & Destructor Documentation"
|
|
.PP
|
|
.SS "QwtSyntheticPointData::QwtSyntheticPointData (size_t size, const \fBQwtInterval\fP & interval = \fC\fBQwtInterval\fP()\fP)"
|
|
Constructor
|
|
.PP
|
|
\fBParameters\fP
|
|
.RS 4
|
|
\fIsize\fP Number of points
|
|
.br
|
|
\fIinterval\fP Bounding interval for the points
|
|
.RE
|
|
.PP
|
|
\fBSee also\fP
|
|
.RS 4
|
|
\fBsetInterval()\fP, \fBsetSize()\fP
|
|
.RE
|
|
.PP
|
|
|
|
.PP
|
|
Definition at line 20 of file qwt_point_data\&.cpp\&.
|
|
.SH "Member Function Documentation"
|
|
.PP
|
|
.SS "QRectF QwtSyntheticPointData::boundingRect () const\fC [override]\fP, \fC [virtual]\fP"
|
|
|
|
.PP
|
|
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 )\&.
|
|
.PP
|
|
\fBReturns\fP
|
|
.RS 4
|
|
Bounding rectangle
|
|
.RE
|
|
.PP
|
|
|
|
.PP
|
|
Reimplemented from \fBQwtPointSeriesData\fP\&.
|
|
.PP
|
|
Definition at line 105 of file qwt_point_data\&.cpp\&.
|
|
.SS "\fBQwtInterval\fP QwtSyntheticPointData::interval () const"
|
|
|
|
.PP
|
|
\fBReturns\fP
|
|
.RS 4
|
|
Bounding interval
|
|
.RE
|
|
.PP
|
|
\fBSee also\fP
|
|
.RS 4
|
|
\fBsetInterval()\fP, \fBsize()\fP
|
|
.RE
|
|
.PP
|
|
|
|
.PP
|
|
Definition at line 62 of file qwt_point_data\&.cpp\&.
|
|
.SS "QRectF QwtSyntheticPointData::rectOfInterest () const"
|
|
|
|
.PP
|
|
\fBReturns\fP
|
|
.RS 4
|
|
'rectangle of interest'
|
|
.RE
|
|
.PP
|
|
\fBSee also\fP
|
|
.RS 4
|
|
\fBsetRectOfInterest()\fP
|
|
.RE
|
|
.PP
|
|
|
|
.PP
|
|
Definition at line 89 of file qwt_point_data\&.cpp\&.
|
|
.SS "QPointF QwtSyntheticPointData::sample (size_t index) const\fC [override]\fP, \fC [virtual]\fP"
|
|
Calculate the point from an index
|
|
.PP
|
|
\fBParameters\fP
|
|
.RS 4
|
|
\fIindex\fP Index
|
|
.RE
|
|
.PP
|
|
\fBReturns\fP
|
|
.RS 4
|
|
QPointF(x(index), y(x(index)));
|
|
.RE
|
|
.PP
|
|
\fBWarning\fP
|
|
.RS 4
|
|
For invalid indices ( index < 0 || index >= \fBsize()\fP ) (0, 0) is returned\&.
|
|
.RE
|
|
.PP
|
|
|
|
.PP
|
|
Reimplemented from \fBQwtArraySeriesData< QPointF >\fP\&.
|
|
.PP
|
|
Definition at line 125 of file qwt_point_data\&.cpp\&.
|
|
.SS "void QwtSyntheticPointData::setInterval (const \fBQwtInterval\fP & interval)"
|
|
Set the bounding interval
|
|
.PP
|
|
\fBParameters\fP
|
|
.RS 4
|
|
\fIinterval\fP Interval
|
|
.RE
|
|
.PP
|
|
\fBSee also\fP
|
|
.RS 4
|
|
\fBinterval()\fP, \fBsetSize()\fP
|
|
.RE
|
|
.PP
|
|
|
|
.PP
|
|
Definition at line 53 of file qwt_point_data\&.cpp\&.
|
|
.SS "void QwtSyntheticPointData::setRectOfInterest (const QRectF & rect)\fC [override]\fP, \fC [virtual]\fP"
|
|
Set a the 'rectangle of interest'
|
|
.PP
|
|
\fBQwtPlotSeriesItem\fP defines the current area of the plot canvas as 'rect of interest' ( \fBQwtPlotSeriesItem::updateScaleDiv()\fP )\&.
|
|
.PP
|
|
If \fBinterval()\fP\&.isValid() == false the x values are calculated in the interval rect\&.left() -> rect\&.right()\&.
|
|
.PP
|
|
\fBSee also\fP
|
|
.RS 4
|
|
\fBrectOfInterest()\fP
|
|
.RE
|
|
.PP
|
|
|
|
.PP
|
|
Reimplemented from \fBQwtSeriesData< QPointF >\fP\&.
|
|
.PP
|
|
Definition at line 78 of file qwt_point_data\&.cpp\&.
|
|
.SS "void QwtSyntheticPointData::setSize (size_t size)"
|
|
Change the number of points
|
|
.PP
|
|
\fBParameters\fP
|
|
.RS 4
|
|
\fIsize\fP Number of points
|
|
.RE
|
|
.PP
|
|
\fBSee also\fP
|
|
.RS 4
|
|
\fBsize()\fP, \fBsetInterval()\fP
|
|
.RE
|
|
.PP
|
|
|
|
.PP
|
|
Definition at line 33 of file qwt_point_data\&.cpp\&.
|
|
.SS "size_t QwtSyntheticPointData::size () const\fC [override]\fP, \fC [virtual]\fP"
|
|
|
|
.PP
|
|
\fBReturns\fP
|
|
.RS 4
|
|
Number of points
|
|
.RE
|
|
.PP
|
|
\fBSee also\fP
|
|
.RS 4
|
|
\fBsetSize()\fP, \fBinterval()\fP
|
|
.RE
|
|
.PP
|
|
|
|
.PP
|
|
Reimplemented from \fBQwtArraySeriesData< QPointF >\fP\&.
|
|
.PP
|
|
Definition at line 42 of file qwt_point_data\&.cpp\&.
|
|
.SS "double QwtSyntheticPointData::x (uint index) const\fC [virtual]\fP"
|
|
Calculate a x-value from an index
|
|
.PP
|
|
x values are calculated by dividing an interval into equidistant steps\&. If !interval()\&.isValid() the interval is calculated from the 'rectangle of interest'\&.
|
|
.PP
|
|
\fBParameters\fP
|
|
.RS 4
|
|
\fIindex\fP Index of the requested point
|
|
.RE
|
|
.PP
|
|
\fBReturns\fP
|
|
.RS 4
|
|
Calculated x coordinate
|
|
.RE
|
|
.PP
|
|
\fBSee also\fP
|
|
.RS 4
|
|
\fBinterval()\fP, \fBrectOfInterest()\fP, \fBy()\fP
|
|
.RE
|
|
.PP
|
|
|
|
.PP
|
|
Definition at line 148 of file qwt_point_data\&.cpp\&.
|
|
.SS "virtual double QwtSyntheticPointData::y (double x) const\fC [pure virtual]\fP"
|
|
Calculate a y value for a x value
|
|
.PP
|
|
\fBParameters\fP
|
|
.RS 4
|
|
\fIx\fP x value
|
|
.RE
|
|
.PP
|
|
\fBReturns\fP
|
|
.RS 4
|
|
Corresponding y value
|
|
.RE
|
|
.PP
|
|
|
|
|
|
.SH "Author"
|
|
.PP
|
|
Generated automatically by Doxygen for Qwt User's Guide from the source code\&.
|