VtkSOADataArrayTemplate Java

Hello all,

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 :slight_smile:
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!

Many thanks,

Cc: @dgobbi (for wrapping) @Yohann_Bearzi (for data structures)

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).


We have made similar observations when passing SoA arrays from cpp to python and did not encounter any problems.

Ok I guess there is development work to do here :slight_smile: