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


C++ QwtPlotCurve类代码示例

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


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

示例1: set_y_axis_logscale

void Data_analysis_gui::set_y_axis_logscale( bool on ) {
  /*
  if (plot_->axisScaleEngine(QwtPlot::xBottom)->transformation()->type() ==
      QwtScaleTransformation::Log10 && on)
    return;

  if (plot_->axisScaleEngine(QwtPlot::xBottom)->transformation()->type() ==
      QwtScaleTransformation::Linear && (!on))
    return;
  */

  if( on ) {
    // Before allowing to go to log scaling, make sure all values are > 0:
    // if some are < 0, return without doing anything
    QwtPlotItemList L = plot_->itemList();
    for (int i = 0; i < L.size(); ++i) {
      if (L[i]->rtti() == QwtPlotItem::Rtti_PlotCurve) {
	QwtPlotCurve * curve = dynamic_cast<QwtPlotCurve*>(L[i]);
	if (curve->minYValue() <= 0)
	  return;
      }
    }
    plot_->setAxisScaleEngine(QwtPlot::yLeft, new QwtLog10ScaleEngine);    
  }
  else
    plot_->setAxisScaleEngine(QwtPlot::yLeft, new QwtLinearScaleEngine);        

  plot_->replot();
}
开发者ID:DMachuca,项目名称:ar2tech-SGeMS-public,代码行数:29,代码来源:data_analysis_gui.cpp

示例2: foreach

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

示例3: setTitleX

void Curves::resamples()
{
    setTitleX();
    foreach(int i, curves.keys()){
        if(i >= file->size()){
            delete curves.take(i);
        }
        else{
            QwtPlotCurve* curve = curves.value(i);
            curve->setSamples(
                file->samples(iX),
                file->samples(i)
            );
        }
    }

    ownerOuts->repaint();

    if(in){
        if(iIn >= file->size()){
            iIn = -1;
            delete in;
            in = NULL;
        }
        else{
            in->setSamples(
                file->samples(iX),
                file->samples(iIn)
            );
        }
        static_cast<InPlot*>(ownerIn)->clearInterval();
    }
}
开发者ID:rasmadeus,项目名称:CorAnalysis,代码行数:33,代码来源:Curves.cpp

示例4: itemList

//--------------------------------------------------------------------------------------------------
/// 
//--------------------------------------------------------------------------------------------------
void RiuSummaryQwtPlot::selectClosestCurve(const QPoint& pos)
{
    QwtPlotCurve* closestCurve = NULL;
    double distMin = DBL_MAX;

    const QwtPlotItemList& itmList = itemList();
    for(QwtPlotItemIterator it = itmList.begin(); it != itmList.end(); it++)
    {
        if((*it)->rtti() == QwtPlotItem::Rtti_PlotCurve)
        {
            QwtPlotCurve* candidateCurve = static_cast<QwtPlotCurve*>(*it);
            double dist = DBL_MAX;
            candidateCurve->closestPoint(pos, &dist);
            if(dist < distMin)
            {
                closestCurve = candidateCurve;
                distMin = dist;
            }
        }
    }

    if(closestCurve && distMin < 20)
    {
        RimSummaryCurve* selectedCurve = m_plotDefinition->findRimCurveFromQwtCurve(closestCurve);
        if(selectedCurve)
        {
            RiaApplication::instance()->getOrCreateAndShowMainPlotWindow()->selectAsCurrentItem(selectedCurve);
        }
    }
}
开发者ID:magnesj,项目名称:ResInsight,代码行数:33,代码来源:RiuSummaryQwtPlot.cpp

示例5: removeSampleSource

 void AmplitudePlot::removeSampleSource(PointSampler* src) {
     QwtPlotCurve* curve = _sources.take(src);
     curve->detach();
     src->disconnect(this);
     delete curve;
     updatePlot();
 }
开发者ID:metasim,项目名称:ews,代码行数:7,代码来源:AmplitudePlot.cpp

示例6: QwtPlotCurve

unsigned int QmitkPlotWidget::InsertCurve(const char* title)
{
  QwtPlotCurve* curve = new QwtPlotCurve(QwtText(title));
  m_PlotCurveVector.push_back(curve);
  curve->attach(m_Plot);
  return static_cast<unsigned int> (m_PlotCurveVector.size() - 1);
}
开发者ID:david-guerrero,项目名称:MITK,代码行数:7,代码来源:QmitkPlotWidget.cpp

示例7: QwtPlotCurve

void Plot::insertCurve(Qt::Orientation o,
    const QColor &c, double base)
{
    QwtPlotCurve *curve = new QwtPlotCurve();

    curve->setPen(c);
    curve->setSymbol(new QwtSymbol(QwtSymbol::Ellipse,
        Qt::gray, c, QSize(8, 8)));

    double x[10];
    double y[sizeof(x) / sizeof(x[0])];

    for ( uint i = 0; i < sizeof(x) / sizeof(x[0]); i++ )
    {
        double v = 5.0 + i * 10.0;
        if ( o == Qt::Horizontal )
        {
            x[i] = v;
            y[i] = base;
        }
        else
        {
            x[i] = base;
            y[i] = v;
        }
    }
        
    curve->setSamples(x, y, sizeof(x) / sizeof(x[0]));
    curve->attach(this);
}
开发者ID:albore,项目名称:pandora,代码行数:30,代码来源:plot.cpp

示例8: setAutoScale

void PlotSettingsDialog::
setAutoScale( const std::vector<QwtPlot*>& plots, QwtPlot::Axis axis ) {
    const double margin = 1.05;

    for( unsigned int i=0 ; i < plots.size() ; i++ ) {
        double max = -9e99;
        double min =  9e99;
        QwtPlotItemList L = plots[i]->itemList();
        for (int id = 0; id < L.size(); ++id) {
            if (L[id]->rtti() != QwtPlotItem::Rtti_PlotCurve)
                continue;

            QwtPlotCurve *curve = dynamic_cast<QwtPlotCurve*>(L[i]);
            if( axis == QwtPlot::xBottom ) {
                max = std::max( max, curve->maxXValue() );
                min = std::min( min, curve->minXValue() );
            }
            else {
                max = std::max( max, curve->maxYValue() );
                min = std::min( min, curve->minYValue() );
            }
        }
        plots[i]->setAxisScale( axis, min*(2-margin), max*margin );
        plots[i]->replot();
    }
}
开发者ID:fnavarrov,项目名称:SGeMS,代码行数:26,代码来源:plot_settings_dialog.cpp

示例9: QwtPlotCurve

void Plot::drawDots(QVector< QVector<struct numCluster> > data, double n, double k, int index, int size, int number)
{
    int j, l;
    QPolygonF points;
    QwtPlotCurve *curve;

    QwtSymbol *symbol;

    points.clear();
    curve = new QwtPlotCurve();//QString("y = norm%1(x)").arg(index));
    curve->setItemAttribute(QwtPlotItem::Legend, false);
    curve->setStyle( QwtPlotCurve::Dots );
    for (l = 0; l < data.size(); l++){
        if (data[l][number].cluster == index){
            // ПЕРЕДЕЛАТЬ если возможно!!! Нужно, чтобы он печатал сразу для всех кластеров одной л.п.
            if (index == 0 && data[l][number].number < n){
                points << QPointF(data[l][number].number, 1);
            }else if (index == size - 1 && data[l][number].number > n){
                points << QPointF(data[l][number].number, 1);
            }else{
                points << QPointF(data[l][number].number, func_normal(data[l][number].number,n,k));
            }

            //std::cout << index << "data = " << data[l][i].number << std::endl;
        }
    }
    curve->setSamples(points);
    switch (index % 5){
    case 0:
        symbol = new QwtSymbol( QwtSymbol::Ellipse,
                                QBrush( Qt::yellow ), QPen( Qt::red, 1 ), QSize( 8, 8 ) );
        curve->setSymbol(symbol);
        break;
    case 1:
        symbol = new QwtSymbol( QwtSymbol::Ellipse,
                                QBrush( Qt::green ), QPen( Qt::red, 1 ), QSize( 8, 8 ) );
        curve->setSymbol(symbol);
        break;
    case 2:
        symbol = new QwtSymbol( QwtSymbol::Ellipse,
                                QBrush( Qt::cyan ), QPen( Qt::red, 1 ), QSize( 8, 8 ) );
        curve->setSymbol(symbol);
        break;
    case 3:
        symbol = new QwtSymbol( QwtSymbol::Ellipse,
                                QBrush( Qt::magenta ), QPen( Qt::red, 1 ), QSize( 8, 8 ) );
        curve->setSymbol(symbol);
        break;
    case 4:
        symbol = new QwtSymbol( QwtSymbol::Ellipse,
                                QBrush( Qt::gray ), QPen( Qt::red, 1 ), QSize( 8, 8 ) );
        curve->setSymbol(symbol);
        break;
    default:
        break;
    }
    curve->attach(this);
    this->replot();
}
开发者ID:kmi9work,项目名称:Fires,代码行数:59,代码来源:plot.cpp

示例10: getSymbolSize

int CurvesModel::getSymbolSize(int row) const {
    SolvWidget* solv =  solvers->at(row);
    QwtPlotCurve* curve = solv->curve;
    if(curve->symbol() != NULL && curve->symbol()->style() != QwtSymbol::NoSymbol) {
            return curve->symbol()->size().width();
    }
    return 7;
}
开发者ID:davisdl48,项目名称:pde1d,代码行数:8,代码来源:curvesmodel.cpp

示例11: getSymbolColor

QColor CurvesModel::getSymbolColor(int row) const { 
    SolvWidget* solv =  solvers->at(row);
    QwtPlotCurve* curve = solv->curve;
    if(curve->symbol() != NULL && curve->symbol()->style() != QwtSymbol::NoSymbol) {
            return curve->symbol()->pen().color();
    }
    return curve->pen().color();
}
开发者ID:davisdl48,项目名称:pde1d,代码行数:8,代码来源:curvesmodel.cpp

示例12: QwtPlotCurve

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

示例13: double

void Plot::drawFunc(QVector params, double (*f)(double, QVector)){
    int j;
    QwtPlotCurve *curve = new QwtPlotCurve(QString("m: %1; a: %2").arg(m).arg(a));
    curve->setData(new FuncData(params, f));
    curve->attach(this);

    this->replot();
}
开发者ID:kmi9work,项目名称:Fires,代码行数:8,代码来源:plot.cpp

示例14: QwtPlotCurve

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

示例15: fit

void ExpDecayDialog::fit()
{
	QString curve = boxName->currentText();
	QwtPlotCurve *c = graph->curve(curve);
	QStringList curvesList = graph->analysableCurvesList();
	if (!c || !curvesList.contains(curve)){
		QMessageBox::critical(this,tr("QtiPlot - Warning"),
				tr("The curve <b> %1 </b> doesn't exist anymore! Operation aborted!").arg(curve));
		boxName->clear();
		boxName->addItems(curvesList);
		return;
	}

	ApplicationWindow *app = (ApplicationWindow *)this->parent();
	if (!app)
        return;

	if (fitter)
        delete fitter;

	if (slopes == 3){
		double x_init[7] = {1.0, boxFirst->value(), 1.0, boxSecond->value(), 1.0, boxThird->value(), boxYOffset->value()};
		fitter = new ThreeExpFit(app, graph);
		fitter->setInitialGuesses(x_init);
	} else if (slopes == 2) {
		double x_init[5] = {1.0, boxFirst->value(), 1.0, boxSecond->value(), boxYOffset->value()};
		fitter = new TwoExpFit(app, graph);
		fitter->setInitialGuesses(x_init);
	} else if (slopes == 1 || slopes == -1){
		double x_init[3] = {boxAmplitude->value(), slopes*boxFirst->value(), boxYOffset->value()};
		fitter = new ExponentialFit(app, graph, slopes == -1);
		fitter->setInitialGuesses(x_init);
	}

  	if (fitter->setDataFromCurve(boxName->currentText(), boxStart->value(), c->maxXValue())){
		fitter->setColor(boxColor->currentItem());
		fitter->scaleErrors(app->fit_scale_errors);
        fitter->setOutputPrecision(app->fit_output_precision);
		fitter->generateFunction(app->generateUniformFitPoints, app->fitPoints);
		fitter->fit();

		double *results = fitter->results();
		boxFirst->setValue(results[1]);
		if (slopes < 2){
            boxAmplitude->setValue(results[0]);
            boxYOffset->setValue(results[2]);
        } else if (slopes == 2){
            boxSecond->setValue(results[3]);
            boxYOffset->setValue(results[4]);
        } else if (slopes == 3){
            boxSecond->setValue(results[3]);
            boxThird->setValue(results[5]);
            boxYOffset->setValue(results[6]);
        }
	}
}
开发者ID:BackupTheBerlios,项目名称:qtiplot-svn,代码行数:56,代码来源:ExpDecayDialog.cpp


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