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


C++ Series::SetData方法代码示例

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


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

示例1: DoTest

bool TestPlotWithArea::DoTest()
{
    Plot *plot;
    plot = new Plot();

    Area *area = new Area2D();

    Box *box1, *box2;
    box1 = new Box(plot);

    box2 = new Box(plot);

    Series *series;
    series = new Series2D("Series");

    DataTyped<int> *xdata;
    xdata = new DataTyped<int>();

    series->SetData(xdata, AXIS_X);

    area->AddSeries(series);
    plot->AddArea(area);

    delete box1;


    delete plot;

    return true;
}
开发者ID:ainur-giniyatov,项目名称:wxPlot,代码行数:30,代码来源:Test.cpp

示例2:

bool TestSeries2DwithData::DoTest()
{
    Series *serie;
    serie = new Series2D("new series");

    DataNoType *xdata, *ydata;
    xdata = new DataTyped<double>(100, "x-data");
    ydata = new DataTyped<double>(100, "y-data");

    serie->SetData(xdata, AXIS_X);
    serie->SetData(ydata, AXIS_Y);

    //delete ydata;
    delete xdata;
    delete serie;
    return true;
}
开发者ID:ainur-giniyatov,项目名称:wxPlot,代码行数:17,代码来源:Test.cpp

示例3: Plot

// plot a new curve, if a figure of the specified figure name already exists,
// the curve will be plot on that figure; if not, a new figure will be created.
void PlotManager::Plot(const string figure_name, const float *p, int count, int step,
					   int R, int G, int B)
{
	if (count < 1)
		return;

	if (step <= 0)
		step = 1;

	// copy data and create a series format.
	float *data_copy = new float[count];

	for (int i = 0; i < count; i++)
		*(data_copy + i) = *(p + step * i);

	Series s;
	s.SetData(count, data_copy);

	if ((R > 0) || (G > 0) || (B > 0))
		s.SetColor(R, G, B, false);

	// search the named window and create one if none was found
	active_figure = FindFigure(figure_name);
	if ( active_figure == NULL)
	{
		Figure new_figure(figure_name);
		figure_list.push_back(new_figure);
		active_figure = FindFigure(figure_name);
		if (active_figure == NULL)
			exit(-1);
	}

	active_series = active_figure->Add(s);
	active_figure->Show();

}
开发者ID:7yadavrupesh,项目名称:imageprocessing,代码行数:38,代码来源:cvplot.cpp


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