how does vtkIdType work?

It looks that vtkIdType can be an integer type with the 32bit or 64bit based on runtime information (, I’m curious how it works, where it is defined, and what are related macro definitions or header files in the latest VTK library.

The size of vtkTypeId depends on the CMake variable VTK_USE_64BIT_IDS. The default value is OFF (resulting in 32bits ids) on 32 bits systems, ON (64bits) on other systems. Then, the file vtkFileTraits.h defines vtkIdType type depending on this variable.

Thanks for the information, is the vtkFileTraits.h created during the building process? I could not find it in the source code repo.

I find it by searching VTK_USE_64BIT_IDS in the source code repo, it looks that the definition is here (

Oups you are right I made a typo in my answer.