This post follows this discussion.
In VTK, cell data and point data hold a concept called “attribute types”. Some of the most noticeable ones are Normals
, Scalars
, and GlobalIds
.
Global ids can be generated using vtkGenerateGlobalIds
, or by the source when implemented.
Currently, in some filters, GlobalIds
usage can be activated through a parameter (see vtkMergeCells::UseGlobalIds
for instance), and in other newer ones, they are used for point / cell matching blindly if available (see vtkGhostCellsGenerator
).
Using global ids instead of point positions can make some pipelines much faster because point or cell matching between partitions can be done using the ids instead of their position in 3D. So it would make sense to use them when available without having to opt-in, assuming that ids are correctly provided (which should be the case). As said earlier, it is already the case for vtkGhostCellsGenerator
, but this behavior could (should?) be extended to all relevant filters.
On top of making filters faster, note that if 2 points have same location but have different data values, the only way to tell that those 2 points should not be considered as a unique point is by assigning them 2 different global ids. So usage of global ids is required in some circumstances.
Is there any objection about making the behavior of blindly using global ids when available in the input the default one for all relevant filters?
A current issue, not on the VTK side, but on higher level applications, such as ParaView, is that there is currently no visual way to know which array is used for global ids. When automatic usage of input global ids is enacted, this will be resolved, probably by writing the relevant array name in bold in the GUI.
Here is another point to talk about. Filters breaking global id information (vtkContourFilter
for instance) currently dump them. They could probably, as proposed in the link above, be converted as pedigree ids. What value could be given to newly generated points? Perhaps -1
? And do we also automate this behavior? i.e. the user should expect global ids to be converted into a pedigree id when ids cannot be carried?