Search code examples
c++vtkparaview

store heterogeneous elements


I would like to generate output files to subsequently visualize in Paraview. I will have:

  • polygons (with scalar attributes)
  • lines (with scalar attributes)
  • data on structured grids

In Paraview, I want to visualize all of them concurrently. For each class (e.g. polygon, lines), the color code will represent the individual attribute value.

Question: do I have to generate one file per class, i.e. one file for the polygons and its attributes, one file for the lines and its attributes, and one file for the grid data, and assemble the 'full picture' manually in Paraview?

Or is there a way to store everything in one single file?


Solution

  • vtkUnstructuredGrid can store all of the cell types in VTK but at the expense of not being able to store structured grid information as compactly as other VTK data sets.

    vtkMultiBlockDataSet is another option. You can have a block for your structured grid and another for unstructured grid data.