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


C++ DataCurve::maxXValue方法代码示例

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


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

示例1: createBaseline

void BaselineDialog::createBaseline()
{
	ApplicationWindow *app = (ApplicationWindow *)parent();
	QPen pen = QPen(Qt::red);

	if (d_baseline){
		pen = d_baseline->pen();
		graph->removeCurve(d_baseline->title().text());
		delete d_baseline;
		d_baseline = NULL;

		if (d_table){
			d_table->askOnCloseEvent(false);
			app->closeWindow(d_table);
			d_table = NULL;
		}
	}

	disableBaselineTool();

	if (btnAutomatic->isChecked()){
		Interpolation *i = new Interpolation(app, graph, boxInputName->currentText(), boxInterpolationMethod->currentIndex());
		i->setOutputPoints(boxPoints->value());
		i->run();
		delete i;
		d_baseline = graph->dataCurve(graph->curveCount() - 1);
		d_table = ((DataCurve *)d_baseline)->table();
	} else if (btnEquation->isChecked()){
		double start = graph->axisScaleDiv(QwtPlot::xBottom)->lowerBound();
		double end = graph->axisScaleDiv(QwtPlot::xBottom)->upperBound();
		DataCurve *c = graph->dataCurve(graph->curveIndex(boxInputName->currentText()));
		if (c){
			start = c->minXValue();
			end = c->maxXValue();
		}
		d_baseline = graph->addFunction(QStringList() << boxEquation->text(), start, end, boxPoints->value(), "x", FunctionCurve::Normal, tr("Baseline"));
	} else if (btnDataset->isChecked()){
		Table *t = app->table(boxTableName->currentText());
		if (t){
			int rows = t->numRows();
			d_table = app->newTable(rows, 2);
			app->setWindowName(d_table, tr("Baseline"));
			app->hideWindow(d_table);
			int ycol = t->colIndex(boxColumnName->currentText());
			int xcol = t->colX(ycol);
			for (int i = 0; i < rows; i++){
				d_table->setText(i, 0, t->text(i, xcol));
				d_table->setText(i, 1, t->text(i, ycol));
			}
			d_baseline = graph->insertCurve(d_table, d_table->objectName() + "_2", Graph::Line, 0, -1);
			graph->setAutoScale();
		}
	}

	if (d_baseline){
		d_baseline->setPen(pen);
		graph->replot();
	}
}
开发者ID:BackupTheBerlios,项目名称:qtiplot-svn,代码行数:59,代码来源:BaselineDialog.cpp


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