Exemplo n.º 1
0
		pass
	def keyPressed(self, e):
		code = int(e.getKeyCode())
		if (code == KeyEvent.VK_F):
			self.view.getCurrentViewable().setSelectionType(Viewable.SelectionType.CELL)
		elif (code == KeyEvent.VK_V):
			self.view.getCurrentViewable().setSelectionType(Viewable.SelectionType.POINT)
			self.view.lock()
			print("Capabilities: " +self.view.GetRenderWindow().ReportCapabilities())
			self.view.unlock()
		elif (code == KeyEvent.VK_E):
			nbrActor = self.view.GetRenderer().GetNumberOfPropsRendered()
			print("Number of actors rendered : " + str(nbrActor))
			print("Number of actors : " + str(self.view.GetRenderer().GetViewProps().GetNumberOfItems()))
		elif code == KeyEvent.VK_P:
			print self.view.GetRenderer().GetActiveCamera()

canvas.addKeyListener(MyKeyListener(canvas))

style = vtkInteractorStyleTrackballCamera()
style.AutoAdjustCameraClippingRangeOn()
canvas.getIren().SetInteractorStyle(style)

frame.setVisible(True)
canvas.cameraManager.fitAll()

if options.batch:
	Utils.takeScreenshot(canvas, options.batch)
	sys.exit(0)

Exemplo n.º 2
0
                Viewable.SelectionType.CELL)
        elif (code == KeyEvent.VK_V):
            self.view.getCurrentViewable().setSelectionType(
                Viewable.SelectionType.POINT)
            self.view.lock()
            print("Capabilities: " +
                  self.view.GetRenderWindow().ReportCapabilities())
            self.view.unlock()
        elif (code == KeyEvent.VK_E):
            nbrActor = self.view.GetRenderer().GetNumberOfPropsRendered()
            print("Number of actors rendered : " + str(nbrActor))
            print(
                "Number of actors : " +
                str(self.view.GetRenderer().GetViewProps().GetNumberOfItems()))
        elif code == KeyEvent.VK_P:
            print self.view.GetRenderer().GetActiveCamera()


canvas.addKeyListener(MyKeyListener(canvas))

style = vtkInteractorStyleTrackballCamera()
style.AutoAdjustCameraClippingRangeOn()
canvas.getIren().SetInteractorStyle(style)

frame.setVisible(True)
canvas.cameraManager.fitAll()

if options.batch:
    Utils.takeScreenshot(canvas, options.batch)
    sys.exit(0)