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

Method SetSize

Charts/Core/vtkChartMatrix.cxx:122–145  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

120
121//------------------------------------------------------------------------------
122void vtkChartMatrix::SetSize(const vtkVector2i& size)
123{
124 if (this->Size.GetX() != size.GetX() || this->Size.GetY() != size.GetY())
125 {
126 this->Size = size;
127 if (size.GetX() * size.GetY() < static_cast<int>(this->Private->ChartElements.size()))
128 {
129 for (int i = static_cast<int>(this->Private->ChartElements.size() - 1);
130 i >= size.GetX() * size.GetY(); --i)
131 {
132 this->RemoveItem(this->Private->ChartElements[i]);
133 }
134 }
135 const std::size_t numCharts = static_cast<std::size_t>(size.GetX()) * size.GetY();
136 this->Private->ChartElements.resize(numCharts);
137 this->Private->Spans.resize(numCharts, vtkVector2i(1, 1));
138 this->Private->XAxisRangeObserverTags.resize(numCharts);
139 this->Private->YAxisRangeObserverTags.resize(numCharts);
140 this->Private->OngoingRangeUpdates.resize(numCharts, false);
141 this->Private->GutterCompensation.resize(
142 numCharts, std::array<float, 4>({ 0.0f, 0.0f, 0.0f, 0.0f }));
143 this->LayoutIsDirty = true;
144 }
145}
146
147//------------------------------------------------------------------------------
148void vtkChartMatrix::SetRect(vtkRecti rect)

Callers 1

PaintMethod · 0.45

Calls 5

vtkVector2iClass · 0.50
GetXMethod · 0.45
sizeMethod · 0.45
RemoveItemMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected