vtkUnstructuredGrid Cell Blanking/Hiding

Is it possible to omit cells from visualisation within an ugrid, by using:

ghostCells->SetValue(cellId, ghostCells->GetValue(cellId) | vtkDataSetAttributes::HIDDENCELL);

When I output a simple pure triangular mesh, where two cells have been refined, producing 4 child cells, the original two parent triangles are not omitted from the cell count in the Inspector view at the bottom, and nor are they removed, for example from the normal glyph filter; a normal is still drawn at the centre of that two original parent cells. How do I mark them accordingly so they are blanked, I tried REFINEDCELL also.

Thanks,
Andy

Andy,
Blanking is not supported for unstructured grids. Only for vtkStructuredGrid and vtkUniformGrids

See
https://blog.kitware.com/ghost-and-blanking-visibility-changes/

Dan

Any advice how to get round this as a hack short of having to generate a copy of the whole mesh minus the cells I want to hide before writing?

You can generate a cell scalar with a special value (very large or very small) for the cells you want to be hidden. Then you can ‘Enable opacity mapping for surfaces’ and manipulate the Opacity curve in the Color Map Editor so that those cells are transparent.

Thanks. That immediately made me think of another way. Negative integer for hidden cells and then just apply a threshold first in the pipeline on the read in mesh?

Yes, that would work as well.

Could you paste an example of how to hide vtkUnstructuredGrid cell?