<div dir="ltr"><font face="monospace, monospace">Hi folks,<br><br>As part of the ongoing effort to support in-situ toolkits such as Catalyst in VTK, we have made some changes to how vtkDataArrays are implemented and used in VTK.</font><div><div><font face="monospace, monospace"><br>In a nutshell, the array-of-structs (AOS) memory layout should no longer be assumed when using vtkDataArrays, and there are new SOA (struct-of-arrays) vtkDataArray implementations included in VTK. This means that methods like GetVoidPointer, WritePointer, etc should no longer be used, and may enter a deprecation phase at some point in the future. This also means that vtkTemplateMacro is no longer the preferred way of interacting with array data efficiently, since it indirectly relies on GetVoidPointer. Existing code using vtkTemplateMacro will continue to work, though it will be very inefficient when used with some of the new array subclasses.<br><br>As a replacement for vtkTemplateMacro, there are some new tools that are used to provide efficient, compile-time optimized access to array data. These tools and their usage are detailed here:</font></div></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace"><a href="http://www.vtk.org/Wiki/VTK/Tutorials/DataArrays">http://www.vtk.org/Wiki/VTK/Tutorials/DataArrays</a> (wiki version)<br></font></div><div><font face="monospace, monospace"><a href="https://gitlab.kitware.com/vtk/vtk/blob/master/Documentation/Doxygen/ArrayDispatch-VTK-7-1.md">https://gitlab.kitware.com/vtk/vtk/blob/master/Documentation/Doxygen/ArrayDispatch-VTK-7-1.md</a> (raw doxygen markdown -- will replace wiki page eventually)<br></font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">The new vtkArrayDispatch tool allows optimized algorithms to be written that work on both vtkAOSDataArrayTemplate (the AOS replacement for vtkDataArrayTemplate) and vtkSOADataArrayTemplate (the new SOA data array backend). The vtkDataArrayAccessor wrapper will then allow the same implementation to fallback to using the generic vtkDataArray API in cases where template-explosion may be an issue.</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">Also note that there is an API change involved with this patch. The typed vtkDataArrayTemplate API methods:</font></div><font face="monospace, monospace"><div><font face="monospace, monospace"><br></font></div>void GetTupleValue(vtkIdType tupleIdx, ValueType *tuple)<br>void SetTupleValue(vtkIdType tupleIdx, const ValueType *tuple)<br>void InsertTupleValue(vtkIdType tupleIdx, const ValueType *tuple)<br>vtkIdType InsertNextTupleValue(const ValueType *tuple)</font><div><pre style="margin-top:0px;margin-bottom:0px"></pre></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace">have been renamed to more clearly indicate their purpose. They are now "GetTypedTuple", etc, and there is a new set of corresponding "GetTypedComponent"-style methods. The old signatures are still available on vtkAOSDataArrayTemplate subclasses and have been marked deprecated. VTK and ParaView have both been updated to use the new APIs.</font></div><div><font face="monospace"><br></font></div><div><font face="monospace">The last iteration of in-situ data array interfaces, namely vtkTypedDataArray and vtkMappedDataArray, will be deprecated at some point due to performance concerns, but continue to be available for the time being.</font></div><div><font face="monospace"><br></font></div><div><font face="monospace">If you encounter any issues with the new implementations or have questions about them, please do not hesitate to email the vtk-developers list and let us know.</font></div><div><font face="monospace"><br></font></div><div><font face="monospace">Best,</font></div><div><font face="monospace">Dave</font></div></div>