本文整理汇总了C++中QwtDoubleRect::setTop方法的典型用法代码示例。如果您正苦于以下问题:C++ QwtDoubleRect::setTop方法的具体用法?C++ QwtDoubleRect::setTop怎么用?C++ QwtDoubleRect::setTop使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QwtDoubleRect
的用法示例。
在下文中一共展示了QwtDoubleRect::setTop方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: boundingRect
QwtDoubleRect VectorCurve::boundingRect() const {
QwtDoubleRect rect = QwtPlotCurve::boundingRect();
QwtDoubleRect vrect = vectorEnd->boundingRect();
if (d_style == XYXY) {
rect.setTop(qMin((double)rect.top(), (double)vrect.top()));
rect.setBottom(qMax((double)rect.bottom(), (double)vrect.bottom()));
rect.setLeft(qMin((double)rect.left(), (double)vrect.left()));
rect.setRight(qMax((double)rect.right(), (double)vrect.right()));
} else {
const double angle = vectorEnd->x(0);
double mag = vectorEnd->y(0);
switch (d_position) {
case Tail:
rect.setTop(
qMin((double)rect.top(), (double)(rect.top() + mag * sin(angle))));
rect.setBottom(qMax((double)rect.bottom(),
(double)(rect.bottom() + mag * sin(angle))));
rect.setLeft(
qMin((double)rect.left(), (double)(rect.left() + mag * cos(angle))));
rect.setRight(qMax((double)rect.right(),
(double)(rect.right() + mag * cos(angle))));
break;
case Middle: {
mag *= 0.5;
rect.setTop(qMin((double)rect.top(),
(double)(rect.top() - fabs(mag * sin(angle)))));
rect.setBottom(qMax((double)rect.bottom(),
(double)(rect.bottom() + fabs(mag * sin(angle)))));
rect.setLeft(qMin((double)rect.left(),
(double)(rect.left() - fabs(mag * cos(angle)))));
rect.setRight(qMax((double)rect.right(),
(double)(rect.right() + fabs(mag * cos(angle)))));
} break;
case Head:
rect.setTop(
qMin((double)rect.top(), (double)(rect.top() - mag * sin(angle))));
rect.setBottom(qMax((double)rect.bottom(),
(double)(rect.bottom() - mag * sin(angle))));
rect.setLeft(
qMin((double)rect.left(), (double)(rect.left() - mag * cos(angle))));
rect.setRight(qMax((double)rect.right(),
(double)(rect.right() - mag * cos(angle))));
break;
}
}
return rect;
}
示例2: boundingRect
QwtDoubleRect HistogramItem::boundingRect() const
{
QwtDoubleRect rect = d_data->data.boundingRect();
if ( !rect.isValid() )
return rect;
if ( d_data->attributes & Xfy )
{
rect = QwtDoubleRect( rect.y(), rect.x(),
rect.height(), rect.width() );
if ( rect.left() > d_data->reference )
rect.setLeft( d_data->reference );
else if ( rect.right() < d_data->reference )
rect.setRight( d_data->reference );
}
else
{
if ( rect.bottom() < d_data->reference )
rect.setBottom( d_data->reference );
else if ( rect.top() > d_data->reference )
rect.setTop( d_data->reference );
}
return rect;
}
示例3: boundingRect
QwtDoubleRect Plot::boundingRect ()
{
QMapIterator<int, QwtPlotCurve *> it = d_curves.begin();
QwtPlotCurve *c = (QwtPlotCurve *)it.data();
double minX = c->minXValue();
double minY = c->minYValue();
double maxX = c->maxXValue();
double maxY = c->maxYValue();
it++;
for (it; it != d_curves.end(); ++it)
{
QwtPlotCurve *c = (QwtPlotCurve *)it.data();
if (!c)
continue;
minX = (c->minXValue() < minX) ? c->minXValue() : minX;
maxX = (c->maxXValue() > maxX) ? c->maxXValue() : maxX;
minY = (c->minYValue() < minY) ? c->minYValue() : minY;
maxY = (c->maxYValue() > maxY) ? c->maxYValue() : maxY;
}
QwtDoubleRect r;
r.setLeft(minX);
r.setRight(maxX);
r.setTop(minY);
r.setBottom(maxY);
return r;
}
示例4: boundingRect
virtual QwtDoubleRect boundingRect() const {
QwtDoubleRect retval = QwtData::boundingRect();
double halfspan = std::max(std::max(fabs(retval.top()), fabs(retval.bottom())), 1e-2);
retval.setTop(-halfspan);
retval.setHeight(halfspan*2.0);
return retval;
}
示例5: boundingRect
QwtDoubleRect PlotCurve::boundingRect() const
{
QwtDoubleRect r = QwtPlotCurve::boundingRect();
double percent = 0.01;
double dw = percent*fabs(r.right() - r.left());
double left = r.left() - dw;
if (left <= 0.0) {
ScaleEngine *sc_engine = (ScaleEngine *)this->plot()->axisScaleEngine(xAxis());
if (sc_engine && (sc_engine->type() == ScaleTransformation::Log10 ||
sc_engine->type() == ScaleTransformation::Log2 ||
sc_engine->type() == ScaleTransformation::Ln))
left = r.left();
}
r.setLeft(left);
r.setRight(r.right() + dw);
double dh = percent*fabs(r.top() - r.bottom());
r.setBottom(r.bottom() + dh);
double top = r.top() - dh;
if (top <= 0.0) {
ScaleEngine *sc_engine = (ScaleEngine *)this->plot()->axisScaleEngine(yAxis());
if (sc_engine && (sc_engine->type() == ScaleTransformation::Log10 ||
sc_engine->type() == ScaleTransformation::Log2 ||
sc_engine->type() == ScaleTransformation::Ln))
top = r.top();
}
r.setTop(top);
return r;
}
示例6: boundingRect
QwtDoubleRect QwtHistogram::boundingRect() const {
QwtDoubleRect rect = QwtPlotCurve::boundingRect();
rect.setLeft(rect.left() - x(1));
rect.setRight(rect.right() + x(dataSize() - 1));
rect.setTop(0);
rect.setBottom(1.2 * rect.bottom());
return rect;
}
示例7: boundingRect
QwtDoubleRect BoxCurve::boundingRect() const {
QwtDoubleRect rect = QwtPlotCurve::boundingRect();
double dy = 0.2 * (rect.bottom() - rect.top());
rect.setTop(rect.top() - dy);
rect.setBottom(rect.bottom() + dy);
rect.setLeft(rect.left() - 0.5);
rect.setRight(rect.right() + 0.5);
return rect;
}
示例8: boundingRect
QwtDoubleRect QmitkHistogram::boundingRect() const
{
QwtDoubleRect rect = m_Data->data.boundingRect();
if ( !rect.isValid() )
return rect;
if ( rect.bottom() < m_Data->reference )
rect.setBottom( m_Data->reference );
else if ( rect.top() > m_Data->reference )
rect.setTop( m_Data->reference );
return rect;
}
示例9:
void
AerolabWindow::zoomInterval(IntervalItem *which) {
QwtDoubleRect rect;
if (!aerolab->byDistance()) {
rect.setLeft(which->start/60);
rect.setRight(which->stop/60);
} else {
rect.setLeft(which->startKM);
rect.setRight(which->stopKM);
}
rect.setTop(aerolab->veCurve->maxYValue()*1.1);
rect.setBottom(aerolab->veCurve->minYValue()-10);
allZoomer->zoom(rect);
}
示例10: boundingRect
QwtDoubleRect QwtErrorPlotCurve::boundingRect() const
{
QwtDoubleRect rect = QwtPlotCurve::boundingRect();
int size = dataSize();
QwtArray <double> X(size), Y(size), min(size), max(size);
for (int i=0; i<size; i++)
{
X[i]=x(i);
Y[i]=y(i);
if (type == Vertical)
{
min[i] = y(i) - err[i];
max[i] = y(i) + err[i];
}
else
{
min[i] = x(i) - err[i];
max[i] = x(i) + err[i];
}
}
QwtArrayData *erMin, *erMax;
if (type == Vertical)
{
erMin=new QwtArrayData(X, min);
erMax=new QwtArrayData(X, max);
}
else
{
erMin=new QwtArrayData(min, Y);
erMax=new QwtArrayData(max, Y);
}
QwtDoubleRect minrect = erMin->boundingRect();
QwtDoubleRect maxrect = erMax->boundingRect();
rect.setTop(QMIN(minrect.top(), maxrect.top()));
rect.setBottom(QMAX(minrect.bottom(), maxrect.bottom()));
rect.setLeft(QMIN(minrect.left(), maxrect.left()));
rect.setRight(QMAX(minrect.right(), maxrect.right()));
delete erMin;
delete erMax;
return rect;
}
示例11: boundingRect
QwtDoubleRect QwtBarCurve::boundingRect() const {
QwtDoubleRect rect = QwtPlotCurve::boundingRect();
double n = (double)dataSize();
if (bar_style == Vertical) {
double dx = (rect.right() - rect.left()) / n;
rect.setLeft(rect.left() - dx);
rect.setRight(rect.right() + dx);
} else {
double dy = (rect.bottom() - rect.top()) / n;
rect.setTop(rect.top() - dy);
rect.setBottom(rect.bottom() + dy);
}
return rect;
}