Exemplo n.º 1
0
    def GetRenderWindow(self):
        """ GetRenderWindow() -> vtkRenderWindow
        Return the associated vtkRenderWindow
        
        """
        if not self.mRenWin:
            win = vtksnl.vtkRenderWindow()
            win.DoubleBufferOn()
            self.SetRenderWindow(win)
            del win

        return self.mRenWin
Exemplo n.º 2
0
    def GetRenderWindow(self):
        """ GetRenderWindow() -> vtkRenderWindow
        Return the associated vtkRenderWindow
        
        """
        if not self.mRenWin:
            win = vtksnl.vtkRenderWindow()
            win.DoubleBufferOn()
            self.SetRenderWindow(win)
            del win

        return self.mRenWin
Exemplo n.º 3
0
 def compute(self):
     r = self.getInputFromPort("renderer").vtkInstance
     window = vtksnl.vtkRenderWindow()
     w = self.forceGetInputFromPort("width", 512)
     h = self.forceGetInputFromPort("height", 512)
     window.OffScreenRenderingOn()
     window.SetSize(w, h)
     # r.ResetCamera()
     window.AddRenderer(r)
     window.Start()
     window.Render()
     win2image = vtksnl.vtkWindowToImageFilter()
     win2image.SetInput(window)
     win2image.Update()
     writer = vtksnl.vtkPNGWriter()
     writer.SetInput(win2image.GetOutput())
     output = self.interpreter.filePool.create_file(suffix='.png')
     writer.SetFileName(output.name)
     writer.Write()
     window.Finalize()
     self.setResult("image", output)
Exemplo n.º 4
0
 def compute(self):
     r = self.get_input("renderer").vtkInstance
     window = vtksnl.vtkRenderWindow()
     w = self.force_get_input("width", 512)
     h = self.force_get_input("height", 512)
     window.OffScreenRenderingOn()
     window.SetSize(w, h)
     # r.ResetCamera()
     window.AddRenderer(r)
     window.Start()
     window.Render()
     win2image = vtksnl.vtkWindowToImageFilter()
     win2image.SetInput(window)
     win2image.Update()
     writer = vtksnl.vtkPNGWriter()
     writer.SetInput(win2image.GetOutput())
     output = self.interpreter.filePool.create_file(suffix='.png')
     writer.SetFileName(output.name)
     writer.Write()
     window.Finalize()
     self.set_output("image", output)