当前位置: 首页>>代码示例>>C++>>正文


C++ QwtDoubleRect::setLeft方法代码示例

本文整理汇总了C++中QwtDoubleRect::setLeft方法的典型用法代码示例。如果您正苦于以下问题:C++ QwtDoubleRect::setLeft方法的具体用法?C++ QwtDoubleRect::setLeft怎么用?C++ QwtDoubleRect::setLeft使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QwtDoubleRect的用法示例。


在下文中一共展示了QwtDoubleRect::setLeft方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
开发者ID:liyulun,项目名称:mantid,代码行数:50,代码来源:VectorCurve.cpp

示例2:

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);
}
开发者ID:ebrandt,项目名称:GoldenCheetah,代码行数:15,代码来源:AerolabWindow.cpp

示例3: 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;
}
开发者ID:gibbogle,项目名称:trophocell2D-abm,代码行数:26,代码来源:histogram_item.cpp

示例4: 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;
}
开发者ID:BackupTheBerlios,项目名称:qtiplot-svn,代码行数:31,代码来源:plot.cpp

示例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;
}
开发者ID:kuzavas,项目名称:qtiplot,代码行数:34,代码来源:PlotCurve.cpp

示例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;
}
开发者ID:liyulun,项目名称:mantid,代码行数:8,代码来源:QwtHistogram.cpp

示例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;
}
开发者ID:gitter-badger,项目名称:AlphaPlot,代码行数:11,代码来源:BoxCurve.cpp

示例8: 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;
}
开发者ID:BackupTheBerlios,项目名称:qtiplot-svn,代码行数:48,代码来源:QwtErrorPlotCurve.cpp

示例9: 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;
}
开发者ID:gitter-badger,项目名称:AlphaPlot,代码行数:16,代码来源:QwtBarCurve.cpp


注:本文中的QwtDoubleRect::setLeft方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。