parameters: (self, evt)
docstring: Draw some random points on the screen.
docstring_summary: Draw some random points on the screen.
docstring_tokens: Draw some random points on the screen .
function: def onDraw(self, evt):
      """ Draw some random points on the screen. """
  
      # Some random points as numpy array
      self.xyz = N.random.random((1000000, 3))
  
      # Convert numpy array to a VTK array
      self.xyzVTK = numpy2vtk(self.xyz)
      
      # Create points
      points = vtk.vtkPoints()
      points.SetData(self.xyzVTK)
      
      # Make polydata  from points
      pd = vtk.vtkPolyData()
      pd.SetPoints(points)
      
      # Point must be transformed to cells to be plotted. vtkMaskPoints can do it for us
      mask = vtk.vtkMaskPoints()
      mask.SetInput(pd)
      mask.GenerateVerticesOn()
      mask.SetOnRatio(1)
  
      # Define a mapper
      m = vtk.vtkPolyDataMapper()
      m.SetInput(mask.GetOutput())
      
      # Define an actor
      actor = vtk.vtkActor()
      actor.SetMapper(m)
      
      # Add the actor to the vtkRenderer
      self.ren.AddActor(actor)
      
      # Reset the camera to view the dataset
      self.ren.ResetCamera()
  
      # Render the scene
      self.widget.Render()
function_tokens: def onDraw ( self , evt ) : # Some random points as numpy array self . xyz = N . random . random ( ( 1000000 , 3 ) ) # Convert numpy array to a VTK array self . xyzVTK = numpy2vtk ( self . xyz ) # Create points points = vtk . vtkPoints ( ) points . SetData ( self . xyzVTK ) # Make polydata  from points pd = vtk . vtkPolyData ( ) pd . SetPoints ( points ) # Point must be transformed to cells to be plotted. vtkMaskPoints can do it for us mask = vtk . vtkMaskPoints ( ) mask . SetInput ( pd ) mask . GenerateVerticesOn ( ) mask . SetOnRatio ( 1 ) # Define a mapper m = vtk . vtkPolyDataMapper ( ) m . SetInput ( mask . GetOutput ( ) ) # Define an actor actor = vtk . vtkActor ( ) actor . SetMapper ( m ) # Add the actor to the vtkRenderer self . ren . AddActor ( actor ) # Reset the camera to view the dataset self . ren . ResetCamera ( ) # Render the scene self . widget . Render ( )