parameters: (self, caller=None, event=None)
docstring: handle events from the render window interactor
docstring_summary: handle events from the render window interactor
docstring_tokens: handle events from the render window interactor
function: def processEvent(self, caller=None, event=None):
      """
      handle events from the render window interactor
      """
  
      if super(DrawEffectTool,self).processEvent(caller,event):
        return
  
      if not self.initialized:
        return
  
      # events from the interactor
      if event == "LeftButtonPressEvent":
        self.actionState = "drawing"
        self.cursorOff()
        xy = self.interactor.GetEventPosition()
        self.addPoint(self.logic.xyToRAS(xy))
        self.abortEvent(event)
      elif event == "LeftButtonReleaseEvent":
        self.actionState = ""
        self.cursorOn()
      elif event == "RightButtonPressEvent":
        sliceNode = self.sliceWidget.sliceLogic().GetSliceNode()
        self.lastInsertSLiceNodeMTime = sliceNode.GetMTime()
      elif event == "RightButtonReleaseEvent":
        sliceNode = self.sliceWidget.sliceLogic().GetSliceNode()
        if self.lastInsertSLiceNodeMTime == sliceNode.GetMTime():
          self.apply()
          self.actionState = None
      elif event == "MouseMoveEvent":
        if self.actionState == "drawing":
          xy = self.interactor.GetEventPosition()
          self.addPoint(self.logic.xyToRAS(xy))
          self.abortEvent(event)
      elif event == "KeyPressEvent":
        key = self.interactor.GetKeySym()
        if key == 'a' or key == 'Return':
          self.apply()
          self.abortEvent(event)
        if key == 'x':
          self.deleteLastPoint()
          self.abortEvent(event)
      else:
        pass
  
      # events from the slice node
      if caller and caller.IsA('vtkMRMLSliceNode'):
        #
        # make sure all points are on the current slice plane
        # - if the SliceToRAS has been modified, then we're on a different plane
        #
        sliceLogic = self.sliceWidget.sliceLogic()
        lineMode = "solid"
        currentSlice = sliceLogic.GetSliceOffset()
        if self.activeSlice:
          offset = abs(currentSlice - self.activeSlice)
          if offset > 0.01:
            lineMode = "dashed"
        self.setLineMode(lineMode)
  
      self.positionActors()
function_tokens: def processEvent ( self , caller = None , event = None ) : if super ( DrawEffectTool , self ) . processEvent ( caller , event ) : return if not self . initialized : return # events from the interactor if event == "LeftButtonPressEvent" : self . actionState = "drawing" self . cursorOff ( ) xy = self . interactor . GetEventPosition ( ) self . addPoint ( self . logic . xyToRAS ( xy ) ) self . abortEvent ( event ) elif event == "LeftButtonReleaseEvent" : self . actionState = "" self . cursorOn ( ) elif event == "RightButtonPressEvent" : sliceNode = self . sliceWidget . sliceLogic ( ) . GetSliceNode ( ) self . lastInsertSLiceNodeMTime = sliceNode . GetMTime ( ) elif event == "RightButtonReleaseEvent" : sliceNode = self . sliceWidget . sliceLogic ( ) . GetSliceNode ( ) if self . lastInsertSLiceNodeMTime == sliceNode . GetMTime ( ) : self . apply ( ) self . actionState = None elif event == "MouseMoveEvent" : if self . actionState == "drawing" : xy = self . interactor . GetEventPosition ( ) self . addPoint ( self . logic . xyToRAS ( xy ) ) self . abortEvent ( event ) elif event == "KeyPressEvent" : key = self . interactor . GetKeySym ( ) if key == 'a' or key == 'Return' : self . apply ( ) self . abortEvent ( event ) if key == 'x' : self . deleteLastPoint ( ) self . abortEvent ( event ) else : pass # events from the slice node if caller and caller . IsA ( 'vtkMRMLSliceNode' ) : # # make sure all points are on the current slice plane # - if the SliceToRAS has been modified, then we're on a different plane # sliceLogic = self . sliceWidget . sliceLogic ( ) lineMode = "solid" currentSlice = sliceLogic . GetSliceOffset ( ) if self . activeSlice : offset = abs ( currentSlice - self . activeSlice ) if offset > 0.01 : lineMode = "dashed" self . setLineMode ( lineMode ) self . positionActors ( )