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


C++ xAxis函数代码示例

本文整理汇总了C++中xAxis函数的典型用法代码示例。如果您正苦于以下问题:C++ xAxis函数的具体用法?C++ xAxis怎么用?C++ xAxis使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了xAxis函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: xAxis

void XYChartCore::paintAxis(QPainter* painter)
{
    const qreal minKey = xAxis()->minimumValue();
    const qreal maxKey = xAxis()->maximumValue();
    const qreal minValue = yAxis()->minimumValue();
    const qreal maxValue = yAxis()->maximumValue();

    const QPointF origo = translatePoint(QPointF(0.0, 0.0));
    const QPointF p1 = translatePoint(QPointF(minKey, 0.0));
    const QPointF p2 = translatePoint(QPointF(maxKey, 0.0));
    const QPointF p3 = translatePoint(QPointF(0.0, minValue));
    const QPointF p4 = translatePoint(QPointF(0.0, maxValue));

    if (origo != p1)
        painter->drawLine(origo, p1);

    if (origo != p2)
        painter->drawLine(origo, p2);

    if (origo != p3)
        painter->drawLine(origo, p3);

    if (origo != p4)
        painter->drawLine(origo, p4);
}
开发者ID:KDE,项目名称:kqtquickcharts,代码行数:25,代码来源:xychartcore.cpp

示例2: plot

void QwtPlotZoomer::rescale()
{
    QwtPlot *plt = plot();
    if ( !plt )
        return;

    const QRectF &rect = d_data->zoomStack[d_data->zoomRectIndex];
    if ( rect != scaleRect() )
    {
        const bool doReplot = plt->autoReplot();
        plt->setAutoReplot( false );

        double x1 = rect.left();
        double x2 = rect.right();
        if ( !plt->axisScaleDiv( xAxis() ).isIncreasing() )
            qSwap( x1, x2 );

        plt->setAxisScale( xAxis(), x1, x2 );

        double y1 = rect.top();
        double y2 = rect.bottom();
        if ( !plt->axisScaleDiv( yAxis() ).isIncreasing() )
            qSwap( y1, y2 );

        plt->setAxisScale( yAxis(), y1, y2 );

        plt->setAutoReplot( doReplot );

        plt->replot();
    }
}
开发者ID:facontidavide,项目名称:PlotJuggler,代码行数:31,代码来源:qwt_plot_zoomer.cpp

示例3: setXValue

void ImageMarker::updateBoundingRect() {
  if (!plot()) return;

  setXValue(plot()->invTransform(xAxis(), d_pos.x()));
  d_x_right = plot()->invTransform(xAxis(), d_pos.x() + d_size.width());

  setYValue(plot()->invTransform(yAxis(), d_pos.y()));
  d_y_bottom = plot()->invTransform(yAxis(), d_pos.y() + d_size.height());
}
开发者ID:gitter-badger,项目名称:AlphaPlot,代码行数:9,代码来源:ImageMarker.cpp

示例4: plot

/*!
  Return normalized bounding rect of the axes

  \warning Calling QwtPlot::setAxisScale() while QwtPlot::autoReplot() is FALSE
           leaves the axis in an 'intermediate' state.
           In this case, to prevent buggy behaviour, you must call
           QwtPlot::replot() before calling QwtPlotPicker::scaleRect().
           This quirk will be removed in a future release.

  \sa QwtPlot::autoReplot(), QwtPlot::replot().
*/
QwtDoubleRect QwtPlotPicker::scaleRect() const
{
    const QwtPlot *plt = plot();

    const QwtDoubleRect rect(
        plt->axisScale(xAxis())->lBound(),
        plt->axisScale(xAxis())->hBound(),
        plt->axisScale(yAxis())->lBound(),
        plt->axisScale(yAxis())->hBound()
    );

    return rect.normalize();
}
开发者ID:BackupTheBerlios,项目名称:qtiplot-svn,代码行数:24,代码来源:qwt_plot_picker.cpp

示例5: clearLabels

void Spectrogram::createLabels()
{
	clearLabels();

	QwtValueList levels = contourLevels();
	const int numLevels = levels.size();
    for (int l = 0; l < numLevels; l++){
		PlotMarker *m = new PlotMarker(l, d_labels_angle);

		QwtText t = QwtText(QString::number(levels[l]));
		t.setColor(d_labels_color);
		t.setFont(d_labels_font);

		if (d_white_out_labels)
			t.setBackgroundBrush(QBrush(Qt::white));
        else
            t.setBackgroundBrush(QBrush(Qt::transparent));
		m->setLabel(t);

        int x_axis = xAxis();
        int y_axis = yAxis();
		m->setAxis(x_axis, y_axis);

        if (d_graph && d_show_labels)
			m->attach(d_graph);
		d_labels_list << m;
	}
}
开发者ID:BackupTheBerlios,项目名称:qtiplot-svn,代码行数:28,代码来源:Spectrogram.cpp

示例6: 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

示例7: makeChamber

BaseIF* makeChamber(const Real& radius,
                    const Real& thick,
                    const Real& offset,
                    const Real& height)
{
  RealVect zero(D_DECL(0.0,0.0,0.0));
  RealVect xAxis(D_DECL(1.0,0.0,0.0));
  bool inside = true;

  Vector<BaseIF*> pieces;

  // Create a chamber
  TiltedCylinderIF chamberOut(radius + thick/2.0,xAxis,zero, inside);
  TiltedCylinderIF chamberIn (radius - thick/2.0,xAxis,zero,!inside);

  IntersectionIF infiniteChamber(chamberIn,chamberOut);

  pieces.push_back(&infiniteChamber);

  RealVect normal1(D_DECL(1.0,0.0,0.0));
  RealVect point1(D_DECL(offset,0.0,0.0));
  PlaneIF plane1(normal1,point1,inside);

  pieces.push_back(&plane1);

  RealVect normal2(D_DECL(-1.0,0.0,0.0));
  RealVect point2(D_DECL(offset+height,0.0,0.0));
  PlaneIF plane2(normal2,point2,inside);

  pieces.push_back(&plane2);

  IntersectionIF* chamber = new IntersectionIF(pieces);

  return chamber;
}
开发者ID:rsnemmen,项目名称:Chombo,代码行数:35,代码来源:pointCoarseningTest.cpp

示例8: minZoomSize

/*!
  Expand the selected rectangle to minZoomSize() and zoom in
  if accepted.

  \param ok If true, complete the selection and emit selected signals
            otherwise discard the selection.

  \sa accept(), minZoomSize()
  \return True if the selection has been accepted, false otherwise
*/
bool QwtPlotZoomer::end( bool ok )
{
    ok = QwtPlotPicker::end( ok );
    if ( !ok )
        return false;

    QwtPlot *plot = QwtPlotZoomer::plot();
    if ( !plot )
        return false;

    const QPolygon &pa = selection();
    if ( pa.count() < 2 )
        return false;

    QRect rect = QRect( pa.first(), pa.last() );
    rect = rect.normalized();

    const QwtScaleMap xMap = plot->canvasMap( xAxis() );
    const QwtScaleMap yMap = plot->canvasMap( yAxis() );

    QRectF zoomRect = QwtScaleMap::invTransform( xMap, yMap, rect ).normalized();

    zoomRect = qwtExpandedZoomRect( zoomRect, minZoomSize(),
        xMap.transformation(), yMap.transformation() );

    zoom( zoomRect );

    return true;
}
开发者ID:facontidavide,项目名称:PlotJuggler,代码行数:39,代码来源:qwt_plot_zoomer.cpp

示例9: xAxis

Matrix RendererD3D::GetBillboardMatrix(Vector cameraPos, Vector upVector)
{
	Vector xAxis(0.0f,0.0f,0.0f);
	Vector yAxis(0.0f,0.0f,0.0f);
	Vector zAxis(0.0f,0.0f,0.0f);
	Vector upVect(0.0f,1.0f,0.0f);

	Vector cameraVector = cameraPos;

	zAxis = cameraVector;
	zAxis.normalize();

	xAxis = zAxis.Cross(upVect);
	xAxis.normalize();

	yAxis = xAxis.Cross(zAxis);
	yAxis.normalize();

	Matrix transform = { xAxis.x, xAxis.y, xAxis.z, 0.0f,
					yAxis.x, yAxis.y, yAxis.z, 0.0f,
					zAxis.x, zAxis.y, zAxis.z, 0.0f,
					0.0f, 0.0f, 0.0f, 1.0f };

	return transform;
}
开发者ID:sknutson,项目名称:Base_Repo,代码行数:25,代码来源:RendererD3D.cpp

示例10: QPoint

QPoint ArrowMarker::endPoint() const {
  if (!plot())
    return QPoint();

  return QPoint(plot()->transform(xAxis(), d_rect.right()),
                plot()->transform(yAxis(), d_rect.bottom()));
}
开发者ID:DanNixon,项目名称:mantid,代码行数:7,代码来源:ArrowMarker.cpp

示例11: makeVanes

BaseIF* makeVanes(const int&      num,
                  const Real&     thick,
                  const RealVect& normal,
                  const Real&     innerRadius,
                  const Real&     outerRadius,
                  const Real&     offset,
                  const Real&     height)
{
  RealVect zero(D_DECL(0.0,0.0,0.0));
  RealVect xAxis(D_DECL(1.0,0.0,0.0));

  BaseIF* oneVane = makeVane(thick,normal,innerRadius,outerRadius,offset,height);

  Vector<BaseIF*> eachVane;

  for (int i = 0; i < num; i++)
  {
    Real angle = i * 2*M_PI / num;

    TransformIF* currentVane = new TransformIF(*oneVane);
    currentVane->rotate(angle,zero,xAxis);

    eachVane.push_back(currentVane);
  }

  UnionIF* allVanes = new UnionIF(eachVane);

  return allVanes;
}
开发者ID:rsnemmen,项目名称:Chombo,代码行数:29,代码来源:swirl.cpp

示例12: plot

void QwtPlotScaleItem::updateBorders()
{
    const QwtPlot *plt = plot();
    if ( plt == NULL || !d_data->scaleDivFromAxis )
        return;
    
    const QRect r = plt->canvas()->contentsRect();
    d_data->canvasRectCache = r;

    QwtDoubleInterval interval;
    if ( d_data->scaleDraw->orientation() == Qt::Horizontal )
    {
        const QwtScaleMap map = plt->canvasMap(xAxis());
        interval.setMinValue(map.invTransform(r.left()));
        interval.setMaxValue(map.invTransform(r.right()));
    }
    else
    {
        const QwtScaleMap map = plt->canvasMap(yAxis());
        interval.setMinValue(map.invTransform(r.bottom()));
        interval.setMaxValue(map.invTransform(r.top()));
    }

    QwtScaleDiv scaleDiv = d_data->scaleDraw->scaleDiv();
    scaleDiv.setInterval(interval);
    d_data->scaleDraw->setScaleDiv(scaleDiv);
}
开发者ID:DTUautopilot,项目名称:qgroundcontrol,代码行数:27,代码来源:qwt_plot_scaleitem.cpp

示例13: QwtPlotMarker

void Grid::enableZeroLineY(bool enable)
{
	Graph *d_plot = (Graph *)plot();
	if (!d_plot)
		return;

	if (!mrkY && enable) {
		mrkY = new QwtPlotMarker();
		d_plot->insertMarker(mrkY);
		mrkY->setRenderHint(QwtPlotItem::RenderAntialiased, false);
		mrkY->setAxis(xAxis(), yAxis());
		mrkY->setLineStyle(QwtPlotMarker::HLine);
		mrkY->setValue(0.0, 0.0);

		QColor c = Qt::black;
		if (d_plot->axisEnabled (QwtPlot::xBottom))
			c = d_plot->axisWidget(QwtPlot::xBottom)->palette().color(QPalette::Foreground);
		else if (d_plot->axisEnabled (QwtPlot::xTop))
			c = d_plot->axisWidget(QwtPlot::xTop)->palette().color(QPalette::Foreground);

		mrkY->setLinePen(QPen(c, d_plot->axesLinewidth(), Qt::SolidLine));
	} else if (mrkY && !enable){
		mrkY->detach();
		d_plot->replot();
		mrkY = NULL;
	}
}
开发者ID:BackupTheBerlios,项目名称:qtiplot-svn,代码行数:27,代码来源:Grid.cpp

示例14: Spectrogram

Spectrogram* Spectrogram::copy(Graph *g)
{
	Spectrogram *new_s = new Spectrogram(g, matrix());
	new_s->setDisplayMode(QwtPlotSpectrogram::ImageMode, testDisplayMode(QwtPlotSpectrogram::ImageMode));
	new_s->setDisplayMode(QwtPlotSpectrogram::ContourMode, testDisplayMode(QwtPlotSpectrogram::ContourMode));
	new_s->setCustomColorMap(color_map);
	new_s->setAxis(xAxis(), yAxis());
	new_s->setDefaultContourPen(defaultContourPen());
	new_s->color_map_policy = color_map_policy;
	new_s->d_show_labels = d_show_labels;
	new_s->d_labels_angle = d_labels_angle;
	new_s->d_labels_color = d_labels_color;
	new_s->d_white_out_labels = d_white_out_labels;
	new_s->d_labels_font = d_labels_font;
	new_s->d_labels_x_offset = d_labels_x_offset;
	new_s->d_labels_y_offset = d_labels_y_offset;

	new_s->setContourLevels(contourLevels());

	if (defaultContourPen().style() == Qt::NoPen && !d_color_map_pen)
		new_s->setContourPenList(d_pen_list);
	else
		new_s->d_color_map_pen = d_color_map_pen;

	QList <PlotMarker *> lst = new_s->labelsList();
	int count = lst.size();
	for(int i = 0; i < count; i++){
		PlotMarker *m = lst[i];
		PlotMarker *mrk = d_labels_list[i];
		if (m && mrk)
			m->setLabelOffset(mrk->xLabelOffset(), mrk->yLabelOffset());
	}
	return new_s;
}
开发者ID:BackupTheBerlios,项目名称:qtiplot-svn,代码行数:34,代码来源:Spectrogram.cpp

示例15: xAxis

void ScrollZoomer::layoutScrollBars(const QRect &rect) {
  int hPos = xAxis();
  if (hScrollBarPosition() == OppositeToScale) hPos = oppositeAxis(hPos);

  int vPos = yAxis();
  if (vScrollBarPosition() == OppositeToScale) vPos = oppositeAxis(vPos);

  ScrollBar *hScrollBar = horizontalScrollBar();
  ScrollBar *vScrollBar = verticalScrollBar();

  const int hdim = hScrollBar ? hScrollBar->extent() : 0;
  const int vdim = vScrollBar ? vScrollBar->extent() : 0;

  if (hScrollBar && hScrollBar->isVisible())
    {
      int x = rect.x();
      int y = (hPos == QwtPlot::xTop) ? rect.top() : rect.bottom() - hdim + 1;
      int w = rect.width();

      if (vScrollBar && vScrollBar->isVisible())
        {
          if (vPos == QwtPlot::yLeft)
            x += vdim;
          w -= vdim;
        }

      hScrollBar->setGeometry(x, y, w, hdim);
    }
  if (vScrollBar && vScrollBar->isVisible())
    {
      int pos = yAxis();
      if (vScrollBarPosition() == OppositeToScale)
        pos = oppositeAxis(pos);

      int x = (vPos == QwtPlot::yLeft) ? rect.left() : rect.right() - vdim + 1;
      int y = rect.y();

      int h = rect.height();

      if (hScrollBar && hScrollBar->isVisible())
        {
          if (hPos == QwtPlot::xTop)
            y += hdim;

          h -= hdim;
        }

      vScrollBar->setGeometry(x, y, vdim, h);
    }
  if (hScrollBar && hScrollBar->isVisible() && vScrollBar
      && vScrollBar->isVisible())
    {
      if (d_cornerWidget)
        {
          QRect cornerRect(vScrollBar->pos().x(), hScrollBar->pos().y(), vdim,
              hdim);
          d_cornerWidget->setGeometry(cornerRect);
        }
    }
}
开发者ID:misterboyle,项目名称:rtxi,代码行数:60,代码来源:scrollzoomer.cpp


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