[vtkusers] Double error check in vtkImageData?
elvis.stansvik at orexplore.com
Thu Aug 31 03:00:13 EDT 2017
I wouldn't call it a mistake, just regular defensive programming. Neither
function is documented as doing any bounds checking, so I would say that
the author of GetScalarPointer was right in checking the args, if the
intention was for that function to provide checking as an undocumented
perk, as the checking done by GetArrayPointer is not part of its contract.
Whether it should be changed for performance reasons I'll leave to the
heavyweights on this list :)
Den 31 aug. 2017 6:54 fm skrev "Andaharoo" <Andx_roo at live.com>:
In vtkImageData, GetScalarPointer(x, y, z) error checks by checking if the
coordinates are in the bounds of the image. It then calls
GetArrayPointer(int) which error checks again (with identical code) which
finally returns the results.
What's the reason for this? Is this a mistake? Seems to me the first error
check is not needed.
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html
Powered by www.kitware.com
Visit other Kitware open-source projects at http://www.kitware.com/
Please keep messages on-topic and check the VTK FAQ at:
Search the list archives at: http://markmail.org/search/?q=vtkusers
Follow this link to subscribe/unsubscribe:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the vtkusers