MCPcopy Create free account
hub / github.com/Kitware/VTK / GetChart

Method GetChart

Charts/Core/vtkChartMatrix.cxx:424–442  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

422
423//------------------------------------------------------------------------------
424vtkChart* vtkChartMatrix::GetChart(const vtkVector2i& position)
425{
426 if (position.GetX() < this->Size.GetX() && position.GetY() < this->Size.GetY())
427 {
428 std::size_t index = position.GetY() * this->Size.GetX() + position.GetX();
429 if (this->Private->ChartElements[index] == nullptr)
430 {
431 vtkNew<vtkChartXY> chart;
432 this->Private->ChartElements[index] = chart;
433 this->AddItem(chart);
434 chart->SetLayoutStrategy(vtkChart::AXES_TO_RECT);
435 }
436 return vtkChart::SafeDownCast(this->Private->ChartElements[index]);
437 }
438 else
439 {
440 return nullptr;
441 }
442}
443
444//------------------------------------------------------------------------------
445bool vtkChartMatrix::SetChartSpan(const vtkVector2i& position, const vtkVector2i& span)

Callers 10

SetActivePlotMethod · 0.45
SetPlotMarkerStyleMethod · 0.45
SetPlotMarkerSizeMethod · 0.45
UpdateLayoutMethod · 0.45
ResizeBigChartMethod · 0.45
UpdateChartSettingsMethod · 0.45
TestChartMatrix2Function · 0.45
TestChartMatrixFunction · 0.45
TestChartMatrix3Function · 0.45

Calls 3

GetXMethod · 0.45
AddItemMethod · 0.45
SetLayoutStrategyMethod · 0.45

Tested by 3

TestChartMatrix2Function · 0.36
TestChartMatrixFunction · 0.36
TestChartMatrix3Function · 0.36