How to reset or clear the renderer window?

You have correctly identified the problem. We don’t know how to clean the VTK pipeline as we are very new to VTK. We have provided the whole code we are using. Your suggestion on this will be of great help to us. How to load data mesh only once and render or clear the combinations of vtp files multiple times on the renderer window?

Thank you so much.

Best regards,
Sunita