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


C++ QwtPlotCurve::draw方法代码示例

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


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

示例1: drawCurve

/*!
  \brief Draw a set of points of a curve.
  When observing an measurement while it is running, new points have to be
  added to an existing curve. drawCurve can be used to display them avoiding
  a complete redraw of the canvas.

  \param key curve key
  \param from index of the first point to be painted
  \param to index of the last point to be painted. If to < 0 the
         curve will be painted to its last point.
  \sa QwtCurve::draw
*/
void QwtPlot::drawCurve(long key, int from, int to)
{
    QwtPlotCurve *curve = d_curves->find(key);
    if ( !curve )
        return;

    QPainter p(canvas());

    p.setClipping(TRUE);
    p.setClipRect(canvas()->contentsRect());

    curve->draw(&p,
        canvasMap(curve->xAxis()), canvasMap(curve->yAxis()),
        from, to);

    if ( canvas()->cacheMode() && canvas()->cache())
    {
        QPainter cachePainter(canvas()->cache());
        cachePainter.translate(-canvas()->contentsRect().x(),
            -canvas()->contentsRect().y());

        curve->draw(&cachePainter,
            canvasMap(curve->xAxis()), canvasMap(curve->yAxis()),
            from, to);
    }
}
开发者ID:jiajw0426,项目名称:easyscada,代码行数:38,代码来源:qwt_plot.cpp

示例2: drawCanvas

//! Redraw grid, curves, and markers. The draw code
//  does not clear clipRegion prior to painting.
//  \param p painter used for drawing
void QwtPlot::drawCanvas(QPainter *p)
{
    QwtDiMap map[axisCnt];
    for ( int axis = 0; axis < axisCnt; axis++ )
        map[axis] = canvasMap(axis);

    QRect rect = d_canvas->contentsRect();

    //
    // draw grid
    //
    if ( d_grid.enabled() &&
         axisEnabled( d_grid.xAxis() ) &&
         axisEnabled( d_grid.yAxis() ) )
    {
        d_grid.draw(p, rect, map[d_grid.xAxis()], map[d_grid.yAxis()]);
    }

    //
    //  draw curves
    //

    QIntDictIterator<QwtPlotCurve> itc(*d_curves);
    for (QwtPlotCurve *curve = itc.toFirst(); curve != 0; curve = ++itc )
    {
      if ( curve->enabled() &&
           axisEnabled( curve->xAxis() ) &&
           axisEnabled( curve->yAxis() ) )
      {
            curve->draw(p, map[curve->xAxis()], map[curve->yAxis()]);
      }
    }

    //
    // draw markers
    //

    QIntDictIterator<QwtPlotMarker> itm(*d_markers);
    for (QwtPlotMarker *marker = itm.toFirst(); marker != 0; marker = ++itm )
    {
        if ( marker->enabled() && axisEnabled( marker->xAxis() ) &&
               axisEnabled( marker->yAxis() ) )
        {
            marker->draw(p,
                map[marker->xAxis()].transform(marker->xValue()),
                map[marker->yAxis()].transform(marker->yValue()),
                rect);
        }
    }
}
开发者ID:ahinoamp,项目名称:Research,代码行数:53,代码来源:qwt_plot.cpp

示例3: drawCanvasItems

void QwtPlot::drawCanvasItems(QPainter *painter, const QRect &rect, 
        const QwtArray<QwtDiMap> &map, const QwtPlotPrintFilter &pfilter) const
{
    //
    // draw grid
    //
    if ( pfilter.options() & QwtPlotPrintFilter::PrintGrid )
    {
        if ( d_grid->enabled() )
        {
            d_grid->draw(painter, rect, 
                map[d_grid->xAxis()], map[d_grid->yAxis()]);
        }
    }

    //
    //  draw curves
    //
    QwtPlotCurveIterator itc = curveIterator();
    for (QwtPlotCurve *curve = itc.toFirst(); curve != 0; curve = ++itc )
    {
        if ( curve->enabled() )
        {
            curve->draw(painter, 
                map[curve->xAxis()], map[curve->yAxis()]);
        }
    }

    //
    // draw markers
    //
    QwtPlotMarkerIterator itm = markerIterator();
    for (QwtPlotMarker *marker = itm.toFirst(); marker != 0; marker = ++itm )
    {
        if ( marker->enabled() )
        {
            marker->draw(painter,
                map[marker->xAxis()].transform(marker->xValue()),
                map[marker->yAxis()].transform(marker->yValue()),
                rect);
        }
    }
}
开发者ID:jiajw0426,项目名称:easyscada,代码行数:43,代码来源:qwt_plot.cpp

示例4: drawContents

void MainWin::drawContents( QPainter *painter )
{
    int deltay, i;

    QRect r = contentsRect();

    deltay = r.height() / CurvCnt - 1;

    r.setHeight( deltay );


    xMap.setPaintInterval( r.left(), r.right() );
    yMap.setPaintInterval( r.top(), r.bottom() );

    painter->setRenderHint( QPainter::Antialiasing,
	curve.testRenderHint( QwtPlotItem::RenderAntialiased ) );
    curve.draw( painter, xMap, yMap, r );

}
开发者ID:NahomKidane,项目名称:QtExamples,代码行数:19,代码来源:main.cpp


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