本文整理汇总了C++中QwtInterval函数的典型用法代码示例。如果您正苦于以下问题:C++ QwtInterval函数的具体用法?C++ QwtInterval怎么用?C++ QwtInterval使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了QwtInterval函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SpectrogramData
SpectrogramData()
{
// setInterval( Qt::XAxis, QwtInterval( -1.5, 1.5 ) );
setInterval( Qt::XAxis, QwtInterval( -1.5, 1.5 ) );
setInterval( Qt::YAxis, QwtInterval( -1.5, 1.5 ) );
setInterval( Qt::ZAxis, QwtInterval( 0.0, 10.0 ) );
}
示例2: setInterval
PlotRasterData::PlotRasterData()
{
setInterval( Qt::XAxis, QwtInterval( -100, 100, QwtInterval::ExcludeMaximum ) );
setInterval( Qt::YAxis, QwtInterval( -100, 100, QwtInterval::ExcludeMaximum ) );
setInterval( Qt::ZAxis, QwtInterval( 0.1, 2.0 ) );
setResampleMode( static_cast<QwtMatrixRasterData::ResampleMode>( 1 ) ); // Сглаживание
}
示例3: QwtRasterData
SaxsviewFrameData::SaxsviewFrameData(const QSize& size)
: QwtRasterData(), p(new Private) {
p->data = saxs_image_create();
saxs_image_set_size(p->data, size.width(), size.height(), 1, 1);
setInterval(Qt::XAxis, QwtInterval(0.0, size.width() - 1.0));
setInterval(Qt::YAxis, QwtInterval(0.0, size.height() - 1.0));
setInterval(Qt::ZAxis, QwtInterval(0.0, 1.0));
}
示例4: SpectrogramData
SpectrogramData()
{
// some minor performance improvements wgen the spectrogram item
// does not need to check for NaN values
setAttribute( QwtRasterData::WithoutGaps, true );
setInterval( Qt::XAxis, QwtInterval( -1.5, 1.5 ) );
setInterval( Qt::YAxis, QwtInterval( -1.5, 1.5 ) );
setInterval( Qt::ZAxis, QwtInterval( 0.0, 10.0 ) );
}
示例5: qAbs
QwtInterval QwtScaleEngine::buildInterval( double value ) const
{
const double delta = ( value == 0.0 ) ? 0.5 : qAbs( 0.5 * value );
if ( DBL_MAX - delta < value )
return QwtInterval( DBL_MAX - delta, DBL_MAX );
if ( -DBL_MAX + delta > value )
return QwtInterval( -DBL_MAX, -DBL_MAX + delta );
return QwtInterval( value - delta, value + delta );
}
示例6: qAbs
QwtInterval QwtScaleEngine::buildInterval( double v ) const
{
const double delta = ( v == 0.0 ) ? 0.5 : qAbs( 0.5 * v );
if ( DBL_MAX - delta < v )
return QwtInterval( DBL_MAX - delta, DBL_MAX );
if ( -DBL_MAX + delta > v )
return QwtInterval( -DBL_MAX, -DBL_MAX + delta );
return QwtInterval( v - delta, v + delta );
}
示例7: QwtInterval
/*!
Interval, that is necessary to display the item
This interval can be useful for operations like clipping or autoscaling
\param scaleId Scale index
\return bounding interval
\sa QwtData::boundingRect()
*/
QwtInterval QwtPolarCurve::boundingInterval( int scaleId ) const
{
const QRectF boundingRect = d_series->boundingRect();
if ( scaleId == QwtPolar::ScaleAzimuth )
return QwtInterval( boundingRect.left(), boundingRect.right() );
if ( scaleId == QwtPolar::ScaleRadius )
return QwtInterval( boundingRect.top(), boundingRect.bottom() );
return QwtInterval();
}
示例8: index
/*!
Return interval of an axis
\param axis Axis index ( see QwtPlot::AxisId )
*/
QwtInterval QwtPlotRescaler::interval( int axis ) const
{
if ( axis < 0 || axis >= QwtPlot::axisCnt )
return QwtInterval();
const QwtPlot *plt = plot();
const double v1 = plt->axisScaleDiv( axis )->lowerBound();
const double v2 = plt->axisScaleDiv( axis )->upperBound();
return QwtInterval( v1, v2 ).normalized();
}
示例9: sl
void FractalControl::setIntervals()
{
const QStringList sl(m_intervalsEdit->text().split(","));
if (sl.size() == 4)
{
setIntervals(
QwtInterval(sl[0].toDouble(), sl[1].toDouble()),
QwtInterval(sl[2].toDouble(), sl[3].toDouble()));
emit changedIntervals();
}
}
示例10: sqrt
void PlotZoz::setData(QVector<double> vecData, float fZoSide, QColor clrPlot, float fPen)
{
pltRasterData->setValueMatrix( vecData, sqrt(vecData.size()) );
pltSpectrogram->setRenderThreadCount( 0 ); // use system specific thread count
pltSpectrogram->setData(pltRasterData);
if (fZoSide != 0) {
pltRasterData->setInterval( Qt::XAxis, QwtInterval( -fZoSide, fZoSide, QwtInterval::ExcludeMaximum ) );
pltRasterData->setInterval( Qt::YAxis, QwtInterval( -fZoSide, fZoSide, QwtInterval::ExcludeMaximum ) );
}
pltSpectrogram->setDefaultContourPen(clrPlot, fPen, Qt::SolidLine);
pltSpectrogram->attach( this );
}
示例11: s
RasterData::RasterData(MouseSpectrogram *spectrogram) :
s(spectrogram),
max(0)
{
memset(d, 0, Statistic::SCREEN_SIZE * Statistic::SCREEN_SIZE * sizeof(int));
setInterval(Qt::XAxis,
QwtInterval(0.0, Statistic::SCREEN_SIZE));
setInterval(Qt::YAxis,
QwtInterval(0.0, Statistic::SCREEN_SIZE));
s->setAxisScale(QwtPlot::xBottom, 0, Statistic::SCREEN_SIZE);
s->setAxisScale(QwtPlot::yLeft, Statistic::SCREEN_SIZE, 0);
s->setAxisScale(QwtPlot::yRight, 0.0, 1.0);
}
示例12: QwtInterval
/*!
\brief Align an interval to a step size
The limits of an interval are aligned that both are integer
multiples of the step size.
\param interval Interval
\param stepSize Step size
\return Aligned interval
*/
QwtInterval QwtLinearScaleEngine::align(
const QwtInterval &interval, double stepSize ) const
{
double x1 = interval.minValue();
double x2 = interval.maxValue();
// when there is no rounding beside some effect, when
// calculating with doubles, we keep the original value
const double eps = 0.000000000001; // since Qt 4.8: qFuzzyIsNull
if ( -DBL_MAX + stepSize <= x1 )
{
const double x = QwtScaleArithmetic::floorEps( x1, stepSize );
if ( qAbs(x) <= eps || !qFuzzyCompare( x1, x ) )
x1 = x;
}
if ( DBL_MAX - stepSize >= x2 )
{
const double x = QwtScaleArithmetic::ceilEps( x2, stepSize );
if ( qAbs(x) <= eps || !qFuzzyCompare( x2, x ) )
x2 = x;
}
return QwtInterval( x1, x2 );
}
示例13: QwtInterval
void Plot::incrementInterval()
{
d_interval = QwtInterval(d_interval.maxValue(),
d_interval.maxValue() + d_interval.width());
CurveData *data0 = static_cast<CurveData *>( d_curve0->data() );
CurveData *data1 = static_cast<CurveData *>( d_curve1->data() );
data0->clearStaleVal(d_interval.minValue());
data1->clearStaleVal(d_interval.minValue());
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_paintedPoints0 = 0;
d_paintedPoints1 = 0;
replot();
}
示例14: QwtInterval
/*!
\brief Calculate a scale division
\param x1 First interval limit
\param x2 Second interval limit
\param maxMajorSteps Maximum for the number of major steps
\param maxMinorSteps Maximum number of minor steps
\param stepSize Step size. If stepSize == 0, the engine
calculates one.
*/
QwtScaleDiv QwtLinearScaleEngine::divideScale( double x1, double x2,
int maxMajorSteps, int maxMinorSteps, double stepSize ) const
{
QwtInterval interval = QwtInterval( x1, x2 ).normalized();
if ( interval.width() <= 0 )
return QwtScaleDiv();
stepSize = qAbs( stepSize );
if ( stepSize == 0.0 )
{
if ( maxMajorSteps < 1 )
maxMajorSteps = 1;
stepSize = QwtScaleArithmetic::divideInterval(
interval.width(), maxMajorSteps, base() );
}
QwtScaleDiv scaleDiv;
if ( stepSize != 0.0 )
{
QList<double> ticks[QwtScaleDiv::NTickTypes];
buildTicks( interval, stepSize, maxMinorSteps, ticks );
scaleDiv = QwtScaleDiv( interval, ticks );
}
if ( x1 > x2 )
scaleDiv.invert();
return scaleDiv;
}
示例15: qwtExpandedZoomInterval
static QwtInterval qwtExpandedZoomInterval( double v1, double v2,
double minRange, const QwtTransform* transform )
{
double min = v1;
double max = v2;
if ( max - min < minRange )
{
min = 0.5 * ( min + max - minRange );
max = min + minRange;
if ( transform )
{
// f.e the logarithmic scale doesn't allow values
// outside [QwtLogTransform::LogMin/QwtLogTransform::LogMax]
double minBounded = transform->bounded( min );
double maxBounded = transform->bounded( max );
if ( minBounded != min )
{
maxBounded = transform->bounded( minBounded + minRange );
}
else if ( maxBounded != max )
{
minBounded = transform->bounded( maxBounded - minRange );
}
min = minBounded;
max = maxBounded;
}
}
return QwtInterval( min, max );
}