Measuring of rendering performance for Remote python-based Visualisation

In VTK 8.2, vtkRenderer::DeviceRender is declared as a pure virtual method, so it will crash unless vtkRenderer is replaced by vtkRenderingOpenGL2:

  /**
   * Create an image. Subclasses of vtkRenderer must implement this method.
   */
  virtual void DeviceRender() =0;

In VTK 9, this method will “do nothing” instead of crashing:

  /**
   * Create an image. Subclasses of vtkRenderer must implement this method.
   */
  virtual void DeviceRender(){};

In Python, when you do “import vtk”, everything is imported – so you get vtkRenderingOpenGL2 automatically. It is possible in Python to load only vtkRenderingCore:

from vtkmodules.vtkRenderingCore import *
# without the following line, rendering will not work:
#from vtkmodules.vtkRenderingOpenGL2 import *
# with the following line, vtkRenderingOpenGL2 is imported automatically:
#from vtk import *

It is equally valid to measure the FPS from C++ or Python, and the results should be very similar (as long as the rendering is working).