We had some trouble transferring vtkMutliblocks of unstructured grids from c++ to java. Since our grids have vtksoaDataArrays of Doubles they obtain invalid pointers when passed to java. Transforming our arrays to classic vrkDoubleArray It is as if vtkJava has vtkAOSDataArrays i.e. vrkDoubleArray but not the SOA equivalent, well that’s a guess actually
As a workaround we deepcopy our data that we seek to avoid.
Any observation of how we could pass vtkSOADataArray from cpp to java would be welcome!
I don’t have much advice to give on this one. The Java wrappers don’t touch templated classes, so they don’t know that vtkAOSDataArrayTemplate<T> is derived from vtkDataArray.
The Java wrappers could be changed to handle unwrapped classes via their base classes. For example, when C++ returns a vtkSOADataArray to Java, the wrappers could use VTK’s IsA() to deduce that it’s a vtkDataArray. But this isn’t implemented. (If anyone is feeling inspired and wants to implement it, the Python wrappers do so here).