本文整理汇总了C++中QwtDoubleRect::x1方法的典型用法代码示例。如果您正苦于以下问题:C++ QwtDoubleRect::x1方法的具体用法?C++ QwtDoubleRect::x1怎么用?C++ QwtDoubleRect::x1使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QwtDoubleRect
的用法示例。
在下文中一共展示了QwtDoubleRect::x1方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateAxes
//! Rebuild the scales and maps
void QwtPlot::updateAxes()
{
int i;
bool resetDone[axisCnt];
for (i = 0; i < axisCnt; i++)
resetDone[i] = FALSE;
//
// Adjust autoscalers
//
QwtPlotCurveIterator itc = curveIterator();
for (const QwtPlotCurve *c = itc.toFirst(); c != 0; c = ++itc )
{
const int xAxis = c->xAxis();
const int yAxis = c->yAxis();
if ( d_as[xAxis].autoScale() || d_as[yAxis].autoScale() )
{
const QwtDoubleRect rect = c->boundingRect();
if ( rect.isValid() )
{
if ( d_as[xAxis].autoScale() )
{
if ( !resetDone[xAxis] )
{
d_as[xAxis].reset();
resetDone[xAxis] = TRUE;
}
d_as[xAxis].adjust(rect.x1(), rect.x2());
}
if ( d_as[yAxis].autoScale() )
{
if ( !resetDone[yAxis] )
{
d_as[yAxis].reset();
resetDone[yAxis] = TRUE;
}
d_as[yAxis].adjust(rect.y1(), rect.y2());
}
}
}
}
//
// Adjust scales
//
for (i = 0; i < axisCnt; i++)
{
d_scale[i]->setScaleDiv(d_as[i].scaleDiv());
int startDist, endDist;
d_scale[i]->minBorderDist(startDist, endDist);
d_scale[i]->setBorderDist(startDist, endDist);
}
d_grid->setXDiv(d_as[d_grid->xAxis()].scaleDiv());
d_grid->setYDiv(d_as[d_grid->yAxis()].scaleDiv());
}
示例2: boundingRect
QwtDoubleRect QwtBarCurve::boundingRect() const
{
QwtDoubleRect rect = QwtCurve::boundingRect();
double n= (double)dataSize();
if (bar_style == Vertical)
{
double dx=(rect.x2()-rect.x1())/n;
rect.setX1(rect.x1()-dx);
rect.setX2(rect.x2()+dx);
}
else
{
double dy=(rect.y2()-rect.y1())/n;
rect.setY1(rect.y1()-dy);
rect.setY2(rect.y2()+dy);
}
return rect;
}
示例3: boundingRect
QwtDoubleRect BoxCurve::boundingRect() const
{
QwtDoubleRect rect = QwtCurve::boundingRect();
double dy=0.2*(rect.y2()-rect.y1());
rect.setY1(rect.y1()-dy);
rect.setY2(rect.y2()+dy);
rect.setX1(rect.x1()-0.5);
rect.setX2(rect.x2()+0.5);
return rect;
}
示例4: transform
/*!
Translate a rectangle from plot into pixel coordinates
\return Rectangle in pixel coordinates
\sa QwtPlotPicker::invTransform()
*/
QRect QwtPlotPicker::transform(const QwtDoubleRect &rect) const
{
QwtDiMap xMap = plot()->canvasMap(d_xAxis);
QwtDiMap yMap = plot()->canvasMap(d_yAxis);
const int x1 = xMap.transform(rect.x1());
const int x2 = xMap.transform(rect.x2());
const int y1 = yMap.transform(rect.y1());
const int y2 = yMap.transform(rect.y2());
return QRect(x1, y1, x2 - x1, y2 - y1);
}