MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / getChart

Method getChart

src/backend/common/graphics_common.cpp:331–364  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

329}
330
331fg_chart ForgeManager::getChart(const fg_window window, const int r,
332 const int c, const fg_chart_type ctype) {
333 auto gIter = mWndGridMap.find(window);
334
335 int rows = std::get<0>(gIter->second);
336 int cols = std::get<1>(gIter->second);
337
338 if (c >= cols || r >= rows) {
339 AF_ERROR("Window Grid points are out of bounds", AF_ERR_TYPE);
340 }
341
342 // upgrade to exclusive access to make changes
343 auto chart_iter = mChartMap.find(window);
344 ChartPtr& chart = (chart_iter->second)[c * rows + r];
345
346 if (!chart) {
347 fg_chart temp = NULL;
348 FG_CHECK(mPlugin->fg_create_chart(&temp, ctype));
349 chart.reset(new Chart({temp}));
350 mChartAxesOverrideMap[chart->handle] = false;
351 } else {
352 fg_chart_type chart_type;
353 FG_CHECK(mPlugin->fg_get_chart_type(&chart_type, chart->handle));
354 if (chart_type != ctype) {
355 // Existing chart is of incompatible type
356 mChartAxesOverrideMap.erase(chart->handle);
357 fg_chart temp = 0;
358 FG_CHECK(mPlugin->fg_create_chart(&temp, ctype));
359 chart.reset(new Chart({temp}));
360 mChartAxesOverrideMap[chart->handle] = false;
361 }
362 }
363 return chart->handle;
364}
365
366unsigned long long ForgeManager::genImageKey(unsigned w, unsigned h,
367 fg_channel_format mode,

Callers 9

af_set_axes_limits_2dFunction · 0.80
af_set_axes_limits_3dFunction · 0.80
af_set_axes_titlesFunction · 0.80
af_set_axes_label_formatFunction · 0.80
setup_vector_fieldFunction · 0.80
setup_histogramFunction · 0.80
setup_plotFunction · 0.80
setup_surfaceFunction · 0.80

Calls 2

findMethod · 0.80
resetMethod · 0.80

Tested by

no test coverage detected