topology-tool-kit / ttk

TTK - Topological Data Analysis and Visualization - Source Code
https://topology-tool-kit.github.io/
Other
406 stars 120 forks source link

[PersistenceDiagram] fix vtuToDiagram for 64 bit ids #1015

Closed MatPont closed 4 months ago

MatPont commented 4 months ago

This PR fixes the vtuToDiagram function when TTK is compiled with 64 bit ids.

In the diagramToVTU function, the arrays ttk::PersistencePairIdentifierName and ttk::VertexScalarFieldName are of types ttkSimplexIdTypeArray (that is either vtkIntArray or vtkIdTypeArray if 64 bit ids is respectively disabled or not). However, currently, the corresponding arrays in the vtuToDiagram function are only read with a SafeDownCast to vtkIntArray returning therefore a nullptr when TTK is compiled with 64 bit ids.

It can leads to problems in other methods using persistence diagrams, for instance executing states/persistenceDiagramClustering.pvsm does not work with 64 bit ids and the current TTK (except if I have missed something).

julien-tierny commented 4 months ago

looks good, thanks!