本文整理汇总了C++中QwtInterval::maxValue方法的典型用法代码示例。如果您正苦于以下问题:C++ QwtInterval::maxValue方法的具体用法?C++ QwtInterval::maxValue怎么用?C++ QwtInterval::maxValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QwtInterval
的用法示例。
在下文中一共展示了QwtInterval::maxValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: qwtIntervalWidthL
static inline long double qwtIntervalWidthL( const QwtInterval &interval )
{
if ( !interval.isValid() )
return 0.0;
return static_cast<long double>( interval.maxValue() )
- static_cast<long double>( interval.minValue() );
}
示例2: divideScale
/*!
\brief Calculate a scale division for an interval
\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.
\return Calculated scale division
*/
QwtScaleDiv QwtLogScaleEngine::divideScale( double x1, double x2,
int maxMajorSteps, int maxMinorSteps, double stepSize ) const
{
QwtInterval interval = QwtInterval( x1, x2 ).normalized();
interval = interval.limited( LOG_MIN, LOG_MAX );
if ( interval.width() <= 0 )
return QwtScaleDiv();
const double logBase = base();
if ( interval.maxValue() / interval.minValue() < logBase )
{
// scale width is less than one decade -> build linear scale
QwtLinearScaleEngine linearScaler;
linearScaler.setAttributes( attributes() );
linearScaler.setReference( reference() );
linearScaler.setMargins( lowerMargin(), upperMargin() );
if ( stepSize != 0.0 )
{
if ( stepSize < 0.0 )
stepSize = -qPow( logBase, -stepSize );
else
stepSize = qPow( logBase, stepSize );
}
return linearScaler.divideScale( x1, x2,
maxMajorSteps, maxMinorSteps, stepSize );
}
stepSize = qAbs( stepSize );
if ( stepSize == 0.0 )
{
if ( maxMajorSteps < 1 )
maxMajorSteps = 1;
stepSize = divideInterval(
qwtLogInterval( logBase, interval ).width(), maxMajorSteps );
if ( stepSize < 1.0 )
stepSize = 1.0; // major step must be >= 1 decade
}
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;
}
示例3: fm
Plot::Plot( QWidget *parent ):
QwtPlot( parent ),
d_formatType( 0 ),
d_alpha(255)
{
d_spectrogram = new QwtPlotSpectrogram();
d_spectrogram->setRenderThreadCount( 0 ); // use system specific thread count
d_spectrogram->setCachePolicy( QwtPlotRasterItem::PaintCache );
QList<double> contourLevels;
for ( double level = 0.5; level < 10.0; level += 1.0 )
contourLevels += level;
d_spectrogram->setContourLevels( contourLevels );
d_spectrogram->setData( new SpectrogramData() );
d_spectrogram->attach( this );
const QwtInterval zInterval = d_spectrogram->data()->interval( Qt::ZAxis );
// A color bar on the right axis
QwtScaleWidget *rightAxis = axisWidget( QwtPlot::yRight );
rightAxis->setTitle( "Intensity" );
rightAxis->setColorBarEnabled( true );
setAxisScale( QwtPlot::yRight, zInterval.minValue(), zInterval.maxValue() );
enableAxis( QwtPlot::yRight );
plotLayout()->setAlignCanvasToScales( true );
setColorMap( Plot::RGBMap );
// LeftButton for the zooming
// MidButton for the panning
// RightButton: zoom out by 1
// Ctrl+RighButton: zoom out to full size
QwtPlotZoomer* zoomer = new MyZoomer( canvas() );
zoomer->setMousePattern( QwtEventPattern::MouseSelect2,
Qt::RightButton, Qt::ControlModifier );
zoomer->setMousePattern( QwtEventPattern::MouseSelect3,
Qt::RightButton );
QwtPlotPanner *panner = new QwtPlotPanner( canvas() );
panner->setAxisEnabled( QwtPlot::yRight, false );
panner->setMouseButton( Qt::MidButton );
// Avoid jumping when labels with more/less digits
// appear/disappear when scrolling vertically
const QFontMetrics fm( axisWidget( QwtPlot::yLeft )->font() );
QwtScaleDraw *sd = axisScaleDraw( QwtPlot::yLeft );
sd->setMinimumExtent( fm.width( "100.00" ) );
const QColor c( Qt::darkBlue );
zoomer->setRubberBandPen( c );
zoomer->setTrackerPen( c );
}
示例4: qwtIsSampleInside
static inline bool qwtIsSampleInside( const QwtOHLCSample &sample,
double tMin, double tMax, double vMin, double vMax )
{
const double t = sample.time;
const QwtInterval interval = sample.boundingInterval();
const bool isOffScreen = ( t < tMin ) || ( t > tMax )
|| ( interval.maxValue() < vMin ) || ( interval.minValue() > vMax );
return !isOffScreen;
}
示例5: PixPlotSpect
void matrixofpixels::PixPlotSpect(int TypeOfSpec,QwtMatrixRasterData *rasterpixdata)
{
changeitems();
MapPlot->setData(rasterpixdata);
MapPlot->setRenderThreadCount(0);
setAxisAutoScale(this->xTop);
setAxisAutoScale(this->xBottom);
switch (TypeOfSpec)
{
case 1:
MapPlot->setColorMap(new ColorMap(BLUERED));
break;
case 2:
MapPlot->setColorMap(new ColorMap(BLACKWHITE));
break;
default:
MapPlot->setColorMap(new ColorMap(BLUERED));
}
MapPlot->attach(/*MainPlot*/this);
const QwtInterval zInterval = MapPlot->data()->interval(Qt::ZAxis);
setAxisScale(QwtPlot::xBottom, 0, Npix);
setAxisMaxMinor(QwtPlot::xBottom, 0);
setAxisScale(QwtPlot::yLeft, 0, Npix);
setAxisMaxMinor(QwtPlot::yLeft, 0);
//rightAxis = new QwtScaleWidget();
QwtScaleWidget *rightAxis = axisWidget(QwtPlot::yRight);
//rightAxis = axisWidget(QwtPlot::yRight);
rightAxis->setColorBarEnabled(true);
rightAxis->setColorBarWidth(20);
rightAxis->setColorMap(zInterval, new ColorMap(TypeOfSpec) );
//ColorMap(TypeOfSpec);
plotLayout()->setAlignCanvasToScales(true);
setAxisScale(QwtPlot::yRight,zInterval.minValue(),zInterval.maxValue());
enableAxis(QwtPlot::yRight);
replot();
setAutoFillBackground(true);
/**
setAutoFillBackground(true); - autozapolnenie, ctobi isklyuchit'
nalozjeniya graphikov
*/
}
示例6: setZoomWindow
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuSummaryQwtPlot::setZoomWindow(const QwtInterval& leftAxis, const QwtInterval& rightAxis, const QwtInterval& timeAxis)
{
{
QRectF zoomWindow;
zoomWindow.setLeft(timeAxis.minValue());
zoomWindow.setRight(timeAxis.maxValue());
zoomWindow.setTop(leftAxis.maxValue());
zoomWindow.setBottom(leftAxis.minValue());
m_zoomerLeft->zoom(zoomWindow);
}
{
QRectF zoomWindow;
zoomWindow.setLeft(timeAxis.minValue());
zoomWindow.setRight(timeAxis.maxValue());
zoomWindow.setTop(rightAxis.maxValue());
zoomWindow.setBottom(rightAxis.minValue());
m_zoomerRight->zoom(zoomWindow);
}
}
示例7: boundingRect
/*!
\return Bounding rectangle of the data
\sa QwtPlotRasterItem::interval()
*/
QRectF QwtPlotRasterItem::boundingRect() const
{
const QwtInterval intervalX = interval( Qt::XAxis );
const QwtInterval intervalY = interval( Qt::YAxis );
if ( !intervalX.isValid() && !intervalY.isValid() )
return QRectF(); // no bounding rect
QRectF r;
if ( intervalX.isValid() )
{
r.setLeft( intervalX.minValue() );
r.setRight( intervalX.maxValue() );
}
else
{
const float max = std::numeric_limits<float>::max();
r.setLeft( -0.5 * max );
r.setWidth( max );
}
if ( intervalY.isValid() )
{
r.setTop( intervalY.minValue() );
r.setBottom( intervalY.maxValue() );
}
else
{
const float max = std::numeric_limits<float>::max();
r.setTop( -0.5 * max );
r.setHeight( max );
}
return r.normalized();
}
示例8: contains
/*!
Check if an interval "contains" a value
\param interval Interval
\param value Value
\return True, when the value is inside the interval
*/
bool QwtScaleEngine::contains(
const QwtInterval &interval, double value ) const
{
if ( !interval.isValid() )
return false;
if ( qwtFuzzyCompare( value, interval.minValue(), interval.width() ) < 0 )
return false;
if ( qwtFuzzyCompare( value, interval.maxValue(), interval.width() ) > 0 )
return false;
return true;
}
示例9: updateScale
void QwtPolarPlot::updateScale( int scaleId )
{
if ( scaleId < 0 || scaleId >= QwtPolar::ScaleCount )
return;
ScaleData &d = d_data->scaleData[scaleId];
double minValue = d.minValue;
double maxValue = d.maxValue;
double stepSize = d.stepSize;
if ( scaleId == QwtPolar::ScaleRadius && d.doAutoScale )
{
QwtInterval interval;
const QwtPolarItemList& itmList = itemList();
for ( QwtPolarItemIterator it = itmList.begin();
it != itmList.end(); ++it )
{
const QwtPolarItem *item = *it;
if ( item->testItemAttribute( QwtPolarItem::AutoScale ) )
interval |= item->boundingInterval( scaleId );
}
minValue = interval.minValue();
maxValue = interval.maxValue();
d.scaleEngine->autoScale( d.maxMajor,
minValue, maxValue, stepSize );
d.scaleDiv.invalidate();
}
if ( !d.scaleDiv.isValid() )
{
d.scaleDiv = d.scaleEngine->divideScale(
minValue, maxValue, d.maxMajor, d.maxMinor, stepSize );
}
const QwtInterval interval = visibleInterval();
const QwtPolarItemList& itmList = itemList();
for ( QwtPolarItemIterator it = itmList.begin();
it != itmList.end(); ++it )
{
QwtPolarItem *item = *it;
item->updateScaleDiv( *scaleDiv( QwtPolar::Azimuth ),
*scaleDiv( QwtPolar::Radius ), interval );
}
}
示例10: qwtLogInterval
/*!
\brief Calculate major ticks for an interval
\param interval Interval
\param stepSize Step size
\return Calculated ticks
*/
QList<double> QwtLogScaleEngine::buildMajorTicks(
const QwtInterval &interval, double stepSize ) const
{
double width = qwtLogInterval( base(), interval ).width();
int numTicks = qRound( width / stepSize ) + 1;
if ( numTicks > 10000 )
numTicks = 10000;
const double lxmin = ::log( interval.minValue() );
const double lxmax = ::log( interval.maxValue() );
const double lstep = ( lxmax - lxmin ) / double( numTicks - 1 );
QList<double> ticks;
ticks += interval.minValue();
for ( int i = 1; i < numTicks - 1; i++ )
ticks += qExp( lxmin + double( i ) * lstep );
ticks += interval.maxValue();
return ticks;
}
示例11: qRound
/*!
\brief Calculate major ticks for an interval
\param interval Interval
\param stepSize Step size
\return Calculated ticks
*/
QList<double> QwtLinearScaleEngine::buildMajorTicks(
const QwtInterval &interval, double stepSize ) const
{
int numTicks = qRound( interval.width() / stepSize ) + 1;
if ( numTicks > 10000 )
numTicks = 10000;
QList<double> ticks;
ticks += interval.minValue();
for ( int i = 1; i < numTicks - 1; i++ )
ticks += interval.minValue() + i * stepSize;
ticks += interval.maxValue();
return ticks;
}
示例12: area
Plot::Plot( QWidget *parent, const QwtInterval &interval ):
QwtPlot( parent )
{
for ( int axis = 0; axis < QwtPlot::axisCnt; axis ++ )
setAxisScale( axis, interval.minValue(), interval.maxValue() );
setCanvasBackground( QColor( Qt::darkBlue ) );
plotLayout()->setAlignCanvasToScales( true );
// grid
QwtPlotGrid *grid = new QwtPlotGrid;
//grid->enableXMin(true);
grid->setMajorPen( Qt::white, 0, Qt::DotLine );
grid->setMinorPen( Qt::gray, 0 , Qt::DotLine );
grid->attach( this );
const int numEllipses = 10;
for ( int i = 0; i < numEllipses; i++ )
{
const double x = interval.minValue() +
qrand() % qRound( interval.width() );
const double y = interval.minValue() +
qrand() % qRound( interval.width() );
const double r = interval.minValue() +
qrand() % qRound( interval.width() / 6 );
const QRectF area( x - r, y - r , 2 * r, 2 * r );
RectItem *item = new RectItem( RectItem::Ellipse );
item->setRenderHint( QwtPlotItem::RenderAntialiased, true );
item->setRect( area );
item->setPen( QPen( Qt::yellow ) );
item->attach( this );
}
TextItem *textItem = new TextItem();
textItem->setText( "Navigation Example" );
textItem->attach( this );
d_rectOfInterest = new RectItem( RectItem::Rect );
d_rectOfInterest->setPen( Qt::NoPen );
QColor c = Qt::gray;
c.setAlpha( 100 );
d_rectOfInterest->setBrush( QBrush( c ) );
d_rectOfInterest->attach( this );
}
示例13: setZAxisScale
void Spectrogramplot::setZAxisScale(double zMin, double zMax)
{
zMin_ = zMin;
zMax_ = zMax;
data_->setInterval( Qt::ZAxis, QwtInterval( zMin_, zMax_ ) );
//Set up the intensity bar on the right
const QwtInterval zInterval = spectrogram_->data()->interval( Qt::ZAxis );
QwtScaleWidget *rightAxis = axisWidget(QwtPlot::yRight);
rightAxis->setColorBarEnabled(true);
rightAxis->setColorMap( zInterval, new ColorMap());
setAxisScale(QwtPlot::yRight, zInterval.minValue(), zInterval.maxValue() );
enableAxis(QwtPlot::yRight);
plotLayout()->setAlignCanvasToScales(true);
replot();
}
示例14: isCombinable
static inline bool isCombinable( const QwtInterval &d1,
const QwtInterval &d2 )
{
if ( d1.isValid() && d2.isValid() )
{
if ( d1.maxValue() == d2.minValue() )
{
if ( !( d1.borderFlags() & QwtInterval::ExcludeMaximum
&& d2.borderFlags() & QwtInterval::ExcludeMinimum ) )
{
return true;
}
}
}
return false;
}
示例15: setFrame
void SaxsviewImage::setFrame(SaxsviewFrame *frame) {
if (p->frame)
p->frame->detach();
p->frame = frame;
frame->attach(this);
if (frame->data()) {
const QwtInterval range = p->frame->data()->interval(Qt::ZAxis);
axisWidget(QwtPlot::yRight)->setColorBarInterval(range);
setAxisScale(QwtPlot::yRight, range.minValue(), range.maxValue());
}
setZoomBase(p->frame->boundingRect());
replot();
}