How to save the VTK created components in memory?

I want to use VTK to create many components, such as cylinder, polydata, unstructured grid and so on. Of course, these components are easy to be created by VTK, but how to save these different types of components in memory? The most important thing is that subsequent operations (such as displaying and modifying component parameters) also need to know the specific type of the component. How should I do?


Just like that of the paraview.
When select Cylinder1, the properties pane can modify its parameters.
I don’t know how to find the corresponding code in Paraview.