in a ParaView I/O plugin for particle data, I am attempting to replace this simple piece of code creating the connectivity list for a POLY_VERTEXCELL (code inspired from vtkConvertToPointCloud)
At run-time, I am greeted with this message,
vtkCellArray.cxx:926 ERR| vtkCellArray (0x60464f495700): Offsets and Connectivity arrays must have the same type.
So, this is telling me that the automatic offset array creation can’t take my AffineArray as input.
I’d appreciate a clue on how to fix this. This functionality should eventually end-up in the conduit source for creating implicit pointset connectivity, as suggested to me by a developer.
I fear this is not doable without modification in vtkCellArray …
Maybe the failing check should be changed to be only based on the vtkAbstractArray::GetDataType instead of relying on concrete class, but this needs some investigation.
@jaswantp has started this MR, https://gitlab.kitware.com/vtk/vtk/-/merge_requests/10769, which is not finished yet, because there are some performance issues to think about and funding of course. This basically allows vtkCellArray to hold any vtkDataArray subclass as offsets or connectivity arrays.
There are some performance issues to think about and funding of course. This basically allows vtkCellArray to hold any vtkDataArray subclass as offsets or connectivity arrays.
Clarifying some points:
Only subclasses of the CRTP vtkGenericDataArray that have the ValueType equivalent to signed integer larger than 2-bytes or any unsigned integer. Floating point is obviously not sensible for connectivity/offsets.
The performance issues only occur when the StorageType is none of OptimalInteger32, OptimalInteger64 which are the default unless vtkCellArray::SetData is called with an unsigned 32/64 bit integer array.
@sujin will be working to get the MR in a ready-to-merge state.
I suspect perf loss is due to all that tunelling through CellStateRoutineInvoker. I haven’t profiled it. If anyone wants to squeeze more performance out of the GenericStorage type, please take a look. I might find time to profile it this week. It’s not a high priority because no existing applications will really see the performance loss.