Esempio n. 1
0
def CreateRenderWindow(renderer, x, y):
    renderWindow = vtk.vtkRenderWindow()
    renderWindow.SetPosition(x, y)
    renderWindow.AddRenderer(renderer)
    renderWindowInteractor = vtk.vtkRenderWindowInteractor()
    renderWindowInteractor.LightFollowCameraOff()
    interactorStyle = vtk.vtkInteractoStyleTrackballCamera()
    renderWindowInteractor.SetInteractorStyle(interactorStyle)
    renderWindow.SetInteractor(renderWindowInteractor)
    renderWindowInteractor.Initialize()
    renderWindow.Render()
    renderWindowInteractor.Start()
Esempio n. 2
0
def RenderWindowMulti(ren):
    renderWindow = vtk.vtkRenderWindow()
    renderWindowInteractor = vtk.vtkRenderWindowInteractor()
    renderWindowInteractor.LightFollowCameraOff()
    interactorStyle = vtk.vtkInteractoStyleTrackballCamera()
    renderWindowInteractor.SetInteractorStyle(interactorStyle)
    renderWindow.SetInteractor(renderWindowInteractor)
   # Definisco i range dei viewport
    xmins=[0, .5, 0, .5]
    xmaxs=[0.5, 1, 0.5, 1]
    ymins=[0, 0, .5, .5]
    ymaxs=[0.5, 0.5, 1, 1]
    for i in range(4):
        renderWindow.AddRenderer(ren)
        ren.SetViewport(xmins[i], ymins[i], xmaxs[i], ymaxs[i])
    renderWindowInteractor.Initialize()
    renderWindow.Render()
    renderWindow.SetWindowName('RW: Mutiple ViewPorts')
    renderWindowInteractor.Start()