MCPcopy Create free account
hub / github.com/arrayfire/forge / fg_add_plot_to_chart

Function fg_add_plot_to_chart

src/api/c/chart.cpp:254–280  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

252}
253
254fg_err fg_add_plot_to_chart(fg_plot* pPlot, fg_chart pChart,
255 const unsigned pNPoints, const fg_dtype pType,
256 const fg_plot_type pPlotType, const fg_marker_type pMarkerType)
257{
258 try {
259 ARG_ASSERT(1, (pChart!=0));
260 ARG_ASSERT(2, (pNPoints>0));
261
262 common::Chart* chrt = getChart(pChart);
263 forge::ChartType ctype = chrt->chartType();
264
265 if (ctype == FG_CHART_2D) {
266 common::Plot* plt = new common::Plot(pNPoints, (forge::dtype)pType, pPlotType,
267 pMarkerType, FG_CHART_2D);
268 chrt->addRenderable(plt->impl());
269 *pPlot = getHandle(plt);
270 } else {
271 common::Plot* plt = new common::Plot(pNPoints, (forge::dtype)pType, pPlotType,
272 pMarkerType, FG_CHART_3D);
273 chrt->addRenderable(plt->impl());
274 *pPlot = getHandle(plt);
275 }
276 }
277 CATCHALL
278
279 return FG_ERR_NONE;
280}
281
282fg_err fg_add_surface_to_chart(fg_surface* pSurface, fg_chart pChart,
283 const unsigned pXPoints, const unsigned pYPoints, const fg_dtype pType,

Callers 1

plotMethod · 0.85

Calls 4

getChartFunction · 0.85
getHandleFunction · 0.85
chartTypeMethod · 0.80
addRenderableMethod · 0.45

Tested by

no test coverage detected