Getting rid of `GetVoidPointer`
As described in this documentation, vtkAbstractArray::GetVoidPointer
is a really bad method to call. A look through the code in VTK shows that new inserted code sometimes features this method. We need a plan to get rid of every instances of this method in VTK so we can deprecate this method so no new code using this method can be added.
The reason this method is really not recommended is that some subclasses of vtkAbstractArray
do not hold a pointer sorted in the order that is assumed by this method. In such instances, a deep copy needs to be performed, which should be avoided if possible. The new ranges / array dispatch mechanisms give a lot of flexibility with arrays, and most of the time, if not always, offer a better / safer path.
As of today, using a git grep GetVoidPointer | wc
, there are a total of 686 instances of GetVoidPointer
.
Edit: Here's a list of modules that need to be cleaned:
-
Charts/Core -
Common/Core -
Common/DataModel -
Filters/AMR -
Filers/Core -
Filters/General -
Filters/Hybrid -
Filters/Modeling -
Filters/Parallel -
Filters/ParallelGeometry -
Filters/ParallelImaging -
Filters/ParallelMPI -
Filters/ParallelStatistics -
Filters/Points -
Filters/SMP -
IO/ADIOS2 -
IO/Asynchronous -
IO/CGNS -
IO/CONVERGECFD -
IO/Chemistry -
IO/EnSight -
IO/Exodus -
IO/Export -
IO/Geometry -
IO/H5part -
IO/Image -
IO/Ioss -
IO/LSDyna -
IO/MINC -
IO/NetCDF -
IO/OMF -
IO/Parallel -
IO/ParallelNetCDF -
IO/Video -
IO/XML -
IO/Xdmf2 -
IO/Xdmf3 -
Imaging/Core -
Imaging/General -
Imaging/Hybrid -
Imaging/Morphological -
Infovis/Core -
Parallel/Core -
Parallel/MPI -
Rendering/ContextOpenGL2 -
Rendering/Core -
Rendering/GL2PSOpenGL2 -
Rendering/Image -
Rendering/LICOpenGL2 -
Rendering/Label -
Redering/OpenGL2 -
Rendering/Parallel -
Rendering/RayTracing -
Rendering/Volume -
Rendering/VolumeOpenGL2 -
Rendering/vtkJS -
ThirdParty/xdmf2 -
Views/Qt -
Wrapping/PythonCore -
Wrapping/Tools