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

Method SetSpanState

Imaging/Core/vtkImagePointDataIterator.cxx:259–291  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

257
258//------------------------------------------------------------------------------
259void vtkImagePointDataIterator::SetSpanState(int idX)
260{
261 // Find the span that includes idX
262 bool inStencil = false;
263 int* spans = *this->SpanListPointer;
264 int n = *this->SpanCountPointer;
265 int i;
266 for (i = 0; i < n; i++)
267 {
268 if (spans[i] > idX)
269 {
270 break;
271 }
272 inStencil = !inStencil;
273 }
274
275 // Set the primary span state variables
276 this->SpanIndex = i;
277 this->InStencil = inStencil;
278
279 // Clamp the span end to MaxX+1
280 int endIdX = this->Extent[1] + 1;
281 if (i < n && spans[i] <= this->Extent[1])
282 {
283 endIdX = spans[i];
284 }
285
286 // Compute the pointers for idX and endIdX
287 vtkIdType rowStart = this->RowEnd - (this->RowIncrement - this->RowEndIncrement);
288
289 this->Id = rowStart + (idX - this->Extent[0]);
290 this->SpanEnd = rowStart + (endIdX - this->Extent[0]);
291}
292
293//------------------------------------------------------------------------------
294void vtkImagePointDataIterator::NextSpan()

Callers 2

InitializeMethod · 0.95
NextSpanMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected