title: How to use Python to implement vtkninteractorstylerubberbandpick to select multiple vtkunstructuredgrid() in selectrenderer?
body: <p>I am writing a vtk program using python,but I couldnot use the rubberband piker for may selection, I have investigated many examples on vtk website, they only introduce the method for observing mouse event,how to extact selection is omit.Is there someone know how to do it? Thanks!</p>
  <p>My code and file are as following,but not work. Reference to <a href="https://stackoverflow.com/questions/50263937/vtk-trying-to-select-visible-cells-in-area-with-vtkrubberbandpick-vtkhardware">VTK: Trying to select visible cells in area with vtkrubberbandpick &amp; vtkHardwareSelector</a></p>
  <p>class MouseInteractorHighLightActor(vtkInteractorStyleRubberBandPick):</p>
  <pre><code>def __init__(self, actor,renderer):
      super(MouseInteractorHighLightActor, self).__init__()
      # self.AddObserver(vtk.vtkCommand.PickEvent, self.PickEvent)
      self.AddObserver(vtk.vtkCommand.KeyPressEvent, self.KeypressCallbackFunction)
  
      self.area_picker = vtk.vtkRenderedAreaPicker()
      self.area_picker.AddObserver(vtk.vtkCommand.EndPickEvent, self.EndPickEvent)
      # self.area_picker.AddObserver(vtk.vtkCommand.PickEvent, self.PickEvent)
      self.startPos=None
      self.endPos=None
      self.selector=vtkHardwareSelector()
      self.actor=actor
      self.renderer=renderer
      return
  
  def KeypressCallbackFunction(self, obj, event):
      self.startPos = self.GetInteractor().GetEventPosition()
      print('Key pressed!')
  
  def PickEvent(self, obj, event):
      self.endPos = self.GetInteractor().GetEventPosition()
      pass
  
  def EndPickEvent(self, obj, event):
      windowSize=[None]*4
      self.endPos = self.GetInteractor().GetEventPosition()
  
      print(self.endPos)
      if self.startPos[0]&lt;self.endPos[0]:
          windowSize[0]=self.startPos[0]
          windowSize[2]=self.endPos[0]
      else:
          windowSize[0]=self.endPos[0]
          windowSize[2]=self.startPos[0]
  
      if self.startPos[1]&lt;self.endPos[1]:
          windowSize[1]=self.startPos[1]
          windowSize[3]=self.endPos[1]
      else:
          windowSize[1]=self.endPos[1]
          windowSize[3]=self.startPos[1]
      self.area_picker.AreaPick(windowSize[0],windowSize[1],windowSize[2],windowSize[3],self.renderer)
      self.selector.SetRenderer(self.GetInteractor().GetRenderWindow().GetRenderers().GetFirstRenderer())
      self.selector.SetArea(windowSize)
      self.selector.SetFieldAssociation(vtkDataObject.FIELD_ASSOCIATION_CELLS)
      self.selector.CaptureBuffers()
      selection = self.selector.GenerateSelection()
      #
      extractSelection = vtkExtractSelection()
      extractSelection.SetInputData(0, self.actor)
      extractSelection.SetInputData(1, selection)
  
      extractSelection.Update()
      selected = vtkUnstructuredGrid()
      selected.ShallowCopy(extractSelection.GetOutput())
  </code></pre>