------------------------------------------------------------------------------
| 120 | |
| 121 | //------------------------------------------------------------------------------ |
| 122 | void 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 | //------------------------------------------------------------------------------ |
| 148 | void vtkChartMatrix::SetRect(vtkRecti rect) |
no test coverage detected