Hiding individual cells from rendering and processing can be done using ghost arrays. Create a vtkUnsignedCharArray
using vtkDataSet::AllocateCellGhostArray
or vtkDataSet::AllocatePointGhostArray
with the same number of tuples as the number of cells/points and set the individual values to vtkDataSetAttributes::HIDDENCELL
or vtkDataSetAttributes::HIDDENPOINT
. This array will serve as a binary mask effectively. See Ghost and Blanking (Visibility) Changes blog post for more details.