本文整理汇总了C++中CurveData::values方法的典型用法代码示例。如果您正苦于以下问题:C++ CurveData::values方法的具体用法?C++ CurveData::values怎么用?C++ CurveData::values使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CurveData
的用法示例。
在下文中一共展示了CurveData::values方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateCurve
void OscilloscopePlot::updateCurve()
{
CurveData *data = static_cast<CurveData *>( d_curve->data() );
data->values().lock();
const int numPoints = data->size();
if ( numPoints > d_paintedPoints )
{
const bool doClip = !canvas()->testAttribute( Qt::WA_PaintOnScreen );
if ( doClip )
{
/*
Depending on the platform setting a clip might be an important
performance issue. F.e. for Qt Embedded this reduces the
part of the backing store that has to be copied out - maybe
to an unaccelerated frame buffer device.
*/
const QwtScaleMap xMap = canvasMap( d_curve->xAxis() );
const QwtScaleMap yMap = canvasMap( d_curve->yAxis() );
QRectF br = qwtBoundingRect( *data,
d_paintedPoints - 1, numPoints - 1 );
const QRect clipRect = QwtScaleMap::transform( xMap, yMap, br ).toRect();
d_directPainter->setClipRegion( clipRect );
}
d_directPainter->drawSeries( d_curve,
d_paintedPoints - 1, numPoints - 1 );
d_paintedPoints = numPoints;
}
data->values().unlock();
}
示例2: replot
void Plot::replot()
{
CurveData *data = (CurveData *)d_curve->data();
data->values().lock();
QwtPlot::replot();
d_paintedPoints = data->size();
data->values().unlock();
}
示例3: replot
void OscilloscopePlot::replot()
{
CurveData *data = static_cast<CurveData *>( d_curve->data() );
data->values().lock();
QwtPlot::replot();
d_paintedPoints = data->size();
data->values().unlock();
}
示例4: updateCurve
void Plot::updateCurve()
{
CurveData *data = (CurveData *)d_curve->data();
data->values().lock();
const int numPoints = d_curve->data()->size();
if ( numPoints > d_paintedPoints )
{
d_directPainter->drawSeries(d_curve,
d_paintedPoints - 1, numPoints - 1);
d_paintedPoints = numPoints;
}
data->values().unlock();
}
示例5: incrementInterval
void OscilloscopePlot::incrementInterval()
{
d_interval = QwtInterval( d_interval.maxValue(),
d_interval.maxValue() + d_interval.width() );
CurveData *data = static_cast<CurveData *>( d_curve->data() );
data->values().clearStaleValues( d_interval.minValue() );
// To avoid, that the grid is jumping, we disable
// the autocalculation of the ticks and shift them
// manually instead.
QwtScaleDiv scaleDiv = axisScaleDiv( QwtPlot::xBottom );
scaleDiv.setInterval( d_interval );
for ( int i = 0; i < QwtScaleDiv::NTickTypes; i++ )
{
QList<double> ticks = scaleDiv.ticks( i );
for ( int j = 0; j < ticks.size(); j++ )
ticks[j] += d_interval.width();
scaleDiv.setTicks( i, ticks );
}
setAxisScaleDiv( QwtPlot::xBottom, scaleDiv );
d_origin->setValue( d_interval.minValue() + d_interval.width() / 2.0, 0.0 );
d_paintedPoints = 0;
replot();
}