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


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

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


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

示例1: setTitle

Plot::Plot()
{
    setTitle("A Simple QwtPlot Demonstration");
    insertLegend(new QwtLegend(), QwtPlot::RightLegend);

    // Set axis titles
    setAxisTitle(xBottom, "x -->");
    setAxisTitle(yLeft, "y -->");
    
    // Insert new curves
    QwtPlotCurve *cSin = new QwtPlotCurve("y = sin(x)");
#if QT_VERSION >= 0x040000
    cSin->setRenderHint(QwtPlotItem::RenderAntialiased);
#endif
    cSin->setPen(QPen(Qt::red));
    cSin->attach(this);

    QwtPlotCurve *cCos = new QwtPlotCurve("y = cos(x)");
#if QT_VERSION >= 0x040000
    cCos->setRenderHint(QwtPlotItem::RenderAntialiased);
#endif
    cCos->setPen(QPen(Qt::blue));
    cCos->attach(this);

    // Create sin and cos data
    const int nPoints = 100;
    cSin->setData(SimpleData(::sin, nPoints));
    cCos->setData(SimpleData(::cos, nPoints));

    // Insert markers
    
    //  ...a horizontal line at y = 0...
    QwtPlotMarker *mY = new QwtPlotMarker();
    mY->setLabel(QString::fromLatin1("y = 0"));
    mY->setLabelAlignment(Qt::AlignRight|Qt::AlignTop);
    mY->setLineStyle(QwtPlotMarker::HLine);
    mY->setYValue(0.0);
    mY->attach(this);

    //  ...a vertical line at x = 2 * pi
    QwtPlotMarker *mX = new QwtPlotMarker();
    mX->setLabel(QString::fromLatin1("x = 2 pi"));
    mX->setLabelAlignment(Qt::AlignLeft | Qt::AlignBottom);
    mX->setLabelOrientation(Qt::Vertical);
    mX->setLineStyle(QwtPlotMarker::VLine);
    mX->setLinePen(QPen(Qt::black, 0, Qt::DashDotLine));
    mX->setXValue(2.0 * M_PI);
    mX->attach(this);
}
开发者ID:376473984,项目名称:pvb,代码行数:49,代码来源:simple.cpp

示例2: addCurve

void HistoricPlot::addCurve(quint32 idVariable, std::vector<VariablePoint> data)
{
    m_zoomer->setZoomBase(true);

    QwtPlotCurve *c = new QwtPlotCurve(QString("id : %1").arg(idVariable));
    c->setPen( QColor(qrand() % 255,qrand() % 255,qrand() % 255), 2 ),
    c->setRenderHint( QwtPlotItem::RenderAntialiased, true );

    QwtSymbol *symbol = new QwtSymbol( QwtSymbol::Ellipse, QBrush( Qt::yellow ), QPen( Qt::red, 2 ), QSize( 5, 5 ) );
    c->setSymbol( symbol );

    QVector<VariablePoint> d2 = QVector<VariablePoint>::fromStdVector(data);
    QVector<QPointF> cleanData;

    for (int i = 0; i < data.size(); ++i) {
        VariablePoint vp = d2.at(i);
        qDebug() << QString("ID: %1, VALUE: %2").arg(vp.idVariable()).arg(vp.value().toDouble());

        if (vp.value().type() == QVariant::Double)
            cleanData.append(QPointF(QwtDate::toDouble(QDateTime::fromMSecsSinceEpoch(vp.timeStamp())),
                                 vp.value().toDouble()));
        else
            cleanData.append(QPointF(QwtDate::toDouble(QDateTime::fromMSecsSinceEpoch(vp.timeStamp())),
                                 (double)vp.value().toLongLong()));
    }

    c->setSamples(cleanData);
    c->attach(this);
}
开发者ID:mujicadiazr,项目名称:BDH,代码行数:29,代码来源:historicplot.cpp

示例3: rebuild

void CDataPlot::rebuild(void)
{
	for(int ci = 0; ci < m_portalCurveMap.count(); ++ci)
	{
		if(m_portalCurveMap.values().at(ci))
		{
			m_portalCurveMap.values().at(ci)->detach();
			delete m_portalCurveMap.values().at(ci);
		}
	}
	m_portalCurveMap.clear();

	if(m_algTreeModel)
	{
		QList<CPortal*> portals = m_algTreeModel->checkedPortalList();
		foreach(CPortal *portal, portals)
		{
			if(!portal) continue;
			QwtPlotCurve *curve = new QwtPlotCurve(portal->caption());
			curve->setData(new CCurveData(portal));
			curve->setPen(portal->dataColor(), 3);
			curve->setRenderHint(QwtPlotItem::RenderAntialiased, true);
			curve->attach(this);
			m_portalCurveMap[portal] = curve;
		}
	}

	refresh();
}
开发者ID:Pala4,项目名称:gCellV0,代码行数:29,代码来源:cdataplot.cpp

示例4: populate

void Plot::populate()
{
    QwtPlotGrid *grid = new QwtPlotGrid();
    grid->setMinorPen( Qt::black, 0, Qt::DashLine );
    grid->enableXMin( true );
    grid->attach( this );

    QwtPlotCurve *curve = new QwtPlotCurve();
    curve->setTitle("Some Points");
    curve->setPen( Qt::blue, 4 ),
          curve->setRenderHint( QwtPlotItem::RenderAntialiased, true );

    QwtSymbol *symbol = new QwtSymbol( QwtSymbol::Ellipse,
                                       QBrush( Qt::yellow ), QPen( Qt::red, 2 ), QSize( 8, 8 ) );
    curve->setSymbol( symbol );

    QPolygonF points;
    points << QPointF( 10.0, 4.4 )
           << QPointF( 100.0, 3.0 ) << QPointF( 200.0, 4.5 )
           << QPointF( 300.0, 6.8 ) << QPointF( 400.0, 7.9 )
           << QPointF( 500.0, 7.1 ) << QPointF( 600.0, 7.9 )
           << QPointF( 700.0, 7.1 ) << QPointF( 800.0, 5.4 )
           << QPointF( 900.0, 2.8 ) << QPointF( 1000.0, 3.6 );
    curve->setSamples( points );
    curve->attach( this );
}
开发者ID:ChangSpivey,项目名称:GoldenCheetah,代码行数:26,代码来源:plot.cpp

示例5: AddPlotData

void PlotWidget::AddPlotData(QString title, float* plotData, int size, bool showMarkers)
{	
	if(_curves.contains(title))
		return;
	QwtPointSeriesData *points = CreatePointSeriesFromArray(plotData, size);
	QwtPlotCurve *curve = new QwtPlotCurve(title);	
	curve->setData(points);
	//Устанавливается цвет
	curve->setPen(QColor(255,0,0), 2.0);
	if(size < 1000)
		curve->setRenderHint(QwtPlotItem::RenderAntialiased);
	//Marker
	if(_showMarkers || showMarkers)
	{
		/*QwtSymbol *symbol1 = new QwtSymbol();
		symbol1->setStyle(QwtSymbol::Ellipse);
		symbol1->setPen(QColor(Qt::black));	
		symbol1->setSize(4);*/
		curve->setSymbol(GetDefaultMarker());
	}
	//Кривая добавляется на график
	curve->attach(_plot);
	//Добавляется в список кривых
	_curves.insert(title, curve);
	//Область рисования перерисовывается, если включен автоматический режим
	CheckNReplot();
}
开发者ID:Funjy,项目名称:RF_60x_QuadView_w,代码行数:27,代码来源:PlotWidget.cpp

示例6: QwtPlotCurve

QwtPlotCurve * PlotViewWidget::addCurveData(WaveformData *curveData, bool secondary, QColor col)
{
    maWaveformData << curveData;

    QwtPlotCurve *waveCurve = new QwtPlotCurve("dummy");
    waveCurve->setRenderHint(QwtPlotItem::RenderAntialiased);
    waveCurve->setPen(QPen(col));
    waveCurve->setSamples( curveData );
    maCurves << waveCurve;
    waveCurve->attach(this);

    if( !mSecondaryAxis || maCurves.length() == 0 ) // no secondary axis or just one plot
    {
        replot();
        setAxisScaleDiv(QwtPlot::yRight, axisScaleDiv(QwtPlot::yLeft));
        replot();
    }
    else
    {
        if(secondary)
        {
            setAxisAutoScale(QwtPlot::yRight);
            waveCurve->setYAxis(QwtPlot::yRight);
        }
        else
        {
            waveCurve->setYAxis(QwtPlot::yLeft);
        }
    }

    repaint();
    return waveCurve;
}
开发者ID:adamb924,项目名称:AcousticWorkspace,代码行数:33,代码来源:plotviewwidget.cpp

示例7: createCurve

//---------------------------------------------------------------------------
void JrkPlotDialog::createCurve(QString title, QColor cl, bool on, double scale)
{
    QwtPlotCurve *curve;    
    QPen pen;

    curve = new QwtPlotCurve(title);

    pen.setColor(cl);
    pen.setWidth(2);

    curve->setPen(pen);

    curve->setPaintAttribute(QwtPlotCurve::ClipPolygons, true);
    curve->setRenderHint( QwtPlotCurve::RenderAntialiased, true);

#if 0
    QwtSplineCurveFitter* curveFitter = new QwtSplineCurveFitter();
    curveFitter->setSplineSize(500);
    curve->setCurveFitter(curveFitter);
#endif

    curve->attach(ui->jrkPlot);
    showCurve(curve, on);

    jrkdata.push_back(new JrkPlotData(curve, scale, samples()));
    // qDebug("Scale: %f", scale);
}
开发者ID:poes-weather,项目名称:Sensor-Benchmark,代码行数:28,代码来源:jrkplotdialog.cpp

示例8: initTmpPlotAndGL

void CentralWidget::initTmpPlotAndGL()
{
    QwtPlot *plot = new QwtPlot(this);
    plot->setTitle( "Plot Demo" );
    plot->setCanvasBackground( Qt::white );
    plot->setAxisScale( QwtPlot::yLeft, 0.0, 10.0 );

    QwtPlotGrid *grid = new QwtPlotGrid();
    grid->attach( plot );

    QwtPlotCurve *curve = new QwtPlotCurve();
    curve->setTitle( "Some Points" );
    curve->setPen( Qt::blue, 4 ),
    curve->setRenderHint( QwtPlotItem::RenderAntialiased, true );

    QPolygonF points;
    points << QPointF( 0.0, 4.4 ) << QPointF( 1.0, 3.0 )
        << QPointF( 2.0, 4.5 ) << QPointF( 3.0, 6.8 )
        << QPointF( 4.0, 7.9 ) << QPointF( 5.0, 7.1 );
    curve->setSamples( points );
    curve->attach( plot );
    this->addTab(plot, tr("Tmp Plot"));

    MyGLWidget *widget = new MyGLWidget(this);
    this->addTab(widget, tr("Tmp OpenGL"));
}
开发者ID:zcwwcw,项目名称:QuickAnalysis,代码行数:26,代码来源:centralwidget.cpp

示例9: createCurve

QwtPlotCurve* Curves::createCurve(int i) const
{
    QwtPlotCurve* curve = new QwtPlotCurve(file->header(i));
    curve->setRenderHint(QwtPlotCurve::RenderAntialiased);
    curve->setPen(QPen(QColor(rand() % 255, rand() % 255, rand() % 255), 2));
    curve->setPaintAttribute(QwtPlotCurve::ClipPolygons);
    return curve;
}
开发者ID:rasmadeus,项目名称:CorAnalysis,代码行数:8,代码来源:Curves.cpp

示例10: main

int main(int argc, char *argv[])
{
	/*const int L = 10; 
	fftw_complex *in; 
	fftw_complex *out;
	gsl_sf_bessel_k0_scaled(0.684684);
	fftw_plan p;

	in = (fftw_complex*) fftw_malloc(sizeof(fftw_complex)*L);
	out = (fftw_complex*) fftw_malloc(sizeof(fftw_complex)*L);
	p = fftw_plan_dft_1d(L, in, out,FFTW_FORWARD,FFTW_MEASURE); 

	fftw_execute(p);
	fftw_destroy_plan(p);
	fftw_free(in);
	fftw_free(out);
	 
	QApplication a(argc, argv);
	Ekg w;
	w.show();
	qDebug() << "sdfsdfsd";
	std::cout << "ALKO PROJEKT CPP CHLOSTA!";			
	
	return a.exec();*/

	    QApplication a( argc, argv );
 
    QwtPlot plot;
    plot.setTitle( "Plot Demo" );
    plot.setCanvasBackground( Qt::white );
    plot.setAxisScale( QwtPlot::yLeft, 0.0, 10.0 );
    plot.insertLegend( new QwtLegend() );
 
    QwtPlotGrid *grid = new QwtPlotGrid();
    grid->attach( &plot );
 
    QwtPlotCurve *curve = new QwtPlotCurve();
    curve->setTitle( "Some Points" );
    curve->setPen( Qt::blue, 4 ),
    curve->setRenderHint( QwtPlotItem::RenderAntialiased, true );
 
    QwtSymbol *symbol = new QwtSymbol( QwtSymbol::Ellipse,
        QBrush( Qt::yellow ), QPen( Qt::red, 2 ), QSize( 8, 8 ) );
    curve->setSymbol( symbol );
 
    QPolygonF points;
    points << QPointF( 0.0, 4.4 ) << QPointF( 1.0, 3.0 )
        << QPointF( 2.0, 4.5 ) << QPointF( 3.0, 6.8 )
        << QPointF( 4.0, 7.9 ) << QPointF( 5.0, 7.1 );
    curve->setSamples( points );
 
    curve->attach( &plot );
  
    plot.resize( 600, 400 );
    plot.show(); 
  
    return a.exec();
}
开发者ID:BiomedEKG,项目名称:ecg_holter,代码行数:58,代码来源:main.cpp

示例11: updatePlotCurves

// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
void StatsGenPlotWidget::updatePlotCurves()
{
// qDebug() << "StatsGenPlotWidget::updatePlotCurves" << "\n";
  //Loop over each entry in the table
  QwtPlotCurve* curve = NULL;

  // Delete all the plots
  qint32 nRows = m_PlotCurves.count();
  for (qint32 r = nRows - 1; r >= 0; --r)
  {
    curve = m_PlotCurves[r];
    curve->detach();
    m_PlotCurves.remove(r);
    delete curve;
  }

  nRows = m_TableModel->rowCount();
  float xMax = 0.0;
  float yMax = 0.0;

  for (qint32 r = 0; r < nRows; ++r)
  {
    if (r == m_PlotCurves.size())
    {
      curve = new QwtPlotCurve("");
      curve->setRenderHint(QwtPlotItem::RenderAntialiased);
      QColor c = QColor(m_TableModel->getColor(r));
      c.setAlpha(UIA::Alpha);
      curve->setPen(QPen(c));
      curve->attach(m_PlotView);
      m_PlotCurves.append(curve);
    }
    else
    {
      curve = m_PlotCurves[r];
      QColor c = QColor(m_TableModel->getColor(r));
      c.setAlpha(UIA::Alpha);
      curve->setPen(QPen(c));
    }

    switch(m_DistributionType)
    {
      case DREAM3D::DistributionType::Beta:
        createBetaCurve(r, xMax, yMax);
        break;
      case DREAM3D::DistributionType::LogNormal:
        createLogNormalCurve(r, xMax, yMax);
        break;
      case DREAM3D::DistributionType::Power:
        createPowerCurve(r, xMax, yMax);
        break;
      default:
        break;
    }
  }
  m_PlotView->replot();

}
开发者ID:kglowins,项目名称:DREAM3D,代码行数:61,代码来源:StatsGenPlotWidget.cpp

示例12: curve

void MQwt::curve(var iX, var iY, var iTitle)
{
    QwtPlotCurve* curve = new QwtPlotCurve(iTitle.str());
    curve->attach(mPlot);
    curve->setRenderHint(QwtPlotItem::RenderAntialiased);
    curve->setSamples(
        iX.ptr<double>(), iY.ptr<double>(), std::min(iX.size(), iY.size())
    );
}
开发者ID:pgarner,项目名称:libube,代码行数:9,代码来源:qwt.cpp

示例13: sampleFormatChanged

void MainWindow::sampleFormatChanged()
{
    for (int i = 0; i < curves.size(); i++) {
        curves[i].curve->detach();
        delete curves[i].curve;
        curves[i].data->clear();
        delete curves[i].data;
    }
    curves.clear();
    timeAxis.clear();

    QList<sampleValue> sampleList = kwp.getSample();
    int numSamples = settingsDialog->rate * settingsDialog->historySecs + 1;

    timeAxis.clear();
    for (int i = 0; i < numSamples; i++) {
        timeAxis.prepend(-i / static_cast<double>(settingsDialog->rate));
    }

    int numColors = sizeof(colorList) / sizeof(QString);

    for (int i = 0; i < sampleList.length(); i++) {
        QwtPlotCurve* curve = new QwtPlotCurve;
        QVector<double>* data = new QVector<double>();
        data->reserve(numSamples+1);
        data->fill(0, numSamples);

        QColor curveColor;
        curveColor.setNamedColor(colorList[i % numColors]);

        int blockNum = sampleList.at(i).refs.at(0).blockNum;
        int pos = sampleList.at(i).refs.at(0).pos;
        blockLabels_t label = kwp.getBlockLabel(blockNum);
        QString desc = label.desc[pos] + " " + label.subDesc[pos];

        curve->setRenderHint(QwtPlotItem::RenderAntialiased);
        curve->setPen(curveColor);
        curve->setTitle(desc);

        curve->setRawSamples(timeAxis.constData(), data->constData(), numSamples);
        curve->attach(ui->plot);

        // set legend checked
        QwtLegendItem *legendItem = qobject_cast<QwtLegendItem*>(ui->plot->legend()->find(curve));
        if (legendItem) {
            legendItem->setChecked(true);
        }

        curveAndData tmp;
        tmp.curve = curve;
        tmp.data = data;
        curves.append(tmp);
    }
}
开发者ID:OwenBrotherwood,项目名称:vag-blocks,代码行数:54,代码来源:mainwindow.cpp

示例14: populate

void Plot::populate()
{
    // Insert new curves
    QwtPlotCurve *cSin = new QwtPlotCurve("y = sin(x)");
    cSin->setRenderHint(QwtPlotItem::RenderAntialiased);
    cSin->setLegendAttribute(QwtPlotCurve::LegendShowLine, true);
    cSin->setPen(QPen(Qt::red));
    cSin->attach(this);

    QwtPlotCurve *cCos = new QwtPlotCurve("y = cos(x)");
    cCos->setRenderHint(QwtPlotItem::RenderAntialiased);
    cCos->setLegendAttribute(QwtPlotCurve::LegendShowLine, true);
    cCos->setPen(QPen(Qt::blue));
    cCos->attach(this);

    // Create sin and cos data
    cSin->setData(new FunctionData(::sin));
    cCos->setData(new FunctionData(::cos));

    // Insert markers
    
    //  ...a horizontal line at y = 0...
    QwtPlotMarker *mY = new QwtPlotMarker();
    mY->setLabel(QString::fromLatin1("y = 0"));
    mY->setLabelAlignment(Qt::AlignRight|Qt::AlignTop);
    mY->setLineStyle(QwtPlotMarker::HLine);
    mY->setYValue(0.0);
    mY->attach(this);

    //  ...a vertical line at x = 2 * pi
    QwtPlotMarker *mX = new QwtPlotMarker();
    mX->setLabel(QString::fromLatin1("x = 2 pi"));
    mX->setLabelAlignment(Qt::AlignLeft | Qt::AlignBottom);
    mX->setLabelOrientation(Qt::Vertical);
    mX->setLineStyle(QwtPlotMarker::VLine);
    mX->setLinePen(QPen(Qt::black, 0, Qt::DashDotLine));
    mX->setXValue(2.0 * M_PI);
    mX->attach(this);
}
开发者ID:albore,项目名称:pandora,代码行数:39,代码来源:sinusplot.cpp

示例15: initCurves

void Plot::initCurves()
{
    QwtPointSeriesData* data = new QwtPointSeriesData();
    
    m_manager.GetPointSeriesData(data, ResourceManager::MF_0);
    
    QwtPlotCurve* curve = new QwtPlotCurve(tr("measured data"));
    curve->setRenderHint(QwtPlotItem::RenderAntialiased);
    curve->setLegendAttribute(QwtPlotCurve::LegendNoAttribute);
    curve->setPen(QPen(Qt::red));
    curve->attach(this);
    curve->setData(data);
}
开发者ID:HorseDream,项目名称:STOKES,代码行数:13,代码来源:widget.cpp


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