本文整理汇总了C++中QwtDoubleRect::normalized方法的典型用法代码示例。如果您正苦于以下问题:C++ QwtDoubleRect::normalized方法的具体用法?C++ QwtDoubleRect::normalized怎么用?C++ QwtDoubleRect::normalized使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QwtDoubleRect
的用法示例。
在下文中一共展示了QwtDoubleRect::normalized方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: zoom
void QwtPlotZoomer::zoom(const QwtDoubleRect &rect)
{
if ( d_data->maxStackDepth >= 0 &&
int(d_data->zoomRectIndex) >= d_data->maxStackDepth )
{
return;
}
const QwtDoubleRect zoomRect = d_data->zoomStack[0] & rect.normalized();
if ( zoomRect != d_data->zoomStack[d_data->zoomRectIndex] )
{
for ( uint i = int(d_data->zoomStack.count()) - 1;
i > d_data->zoomRectIndex; i-- )
{
(void)d_data->zoomStack.pop();
}
d_data->zoomStack.push(zoomRect);
d_data->zoomRectIndex++;
rescale();
emit zoomed(zoomRect);
}
}
示例2: QwtDoubleRect
/*!
Returns the intersection of this rectangle and rectangle other.
Returns an empty rectangle if there is no intersection.
*/
QwtDoubleRect QwtDoubleRect::operator&(const QwtDoubleRect &other) const
{
if (isNull() || other.isNull())
return QwtDoubleRect();
const QwtDoubleRect r1 = normalized();
const QwtDoubleRect r2 = other.normalized();
const double minX = qwtMax(r1.left(), r2.left());
const double maxX = qwtMin(r1.right(), r2.right());
const double minY = qwtMax(r1.top(), r2.top());
const double maxY = qwtMin(r1.bottom(), r2.bottom());
return QwtDoubleRect(minX, minY, maxX - minX, maxY - minY);
}
示例3: scaleRect
/*!
Return normalized bounding rect of the axes
\sa QwtPlot::autoReplot(), QwtPlot::replot().
*/
QwtDoubleRect QwtPlotPicker::scaleRect() const
{
QwtDoubleRect rect;
if ( plot() )
{
const QwtScaleDiv *xs = plot()->axisScaleDiv(xAxis());
const QwtScaleDiv *ys = plot()->axisScaleDiv(yAxis());
if ( xs && ys )
{
rect = QwtDoubleRect( xs->lowerBound(), ys->lowerBound(),
xs->range(), ys->range() );
rect = rect.normalized();
}
}
return rect;
}