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

Method GoToNextElement

Charts/Core/vtkChartMatrix.cxx:219–257  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

217
218//------------------------------------------------------------------------------
219void vtkChartMatrix::GoToNextElement(vtkVector2i& index, vtkVector2f& offset)
220{
221 const int& numRows = this->Size.GetY();
222 int& i = this->Private->Index[0];
223 int& j = this->Private->Index[1];
224 constexpr int FIRST = 0;
225
226 // increment j
227 ++j;
228 // reset j, increment i if necessary
229 if (!(j % numRows))
230 {
231 j = 0;
232 ++i;
233 // Compute next column's x offset
234 switch (i)
235 {
236 case FIRST:
237 break;
238 default:
239 this->Private->Offset[0] += this->Private->Increment[0] + this->Gutter[0];
240 break;
241 }
242 }
243
244 // Compute next row's y offset
245 switch (j)
246 {
247 case FIRST:
248 this->Private->Offset[1] = this->Private->Start[1];
249 break;
250 default:
251 this->Private->Offset[1] += this->Private->Increment[1] + this->Gutter[1];
252 break;
253 }
254
255 index = this->Private->Index;
256 offset = this->Private->Offset;
257}
258
259//------------------------------------------------------------------------------
260bool vtkChartMatrix::IsDoneWithTraversal()

Callers 2

PaintMethod · 0.95
GetChartIndexMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected