def off_screen_viewer(): """A factory that creates an offscreen viewer.""" win = TVTKWindow(off_screen_rendering=True) # Need to set some non-zero size for the off screen window. If # not we get VTK errors on Linux. win.scene.set_size((300, 300)) return win
def off_screen_viewer_factory(size=(400, 350)): """A factory that creates an offscreen viewer.""" win = TVTKWindow(off_screen_rendering=True) # Set all preferences. set_scene_preferences(win.scene) # Set the size. win.scene.set_size(size) return win