Beispiel #1
0
    def onEvent(self, obj, event):

        if event.type() == QtCore.QEvent.MouseButtonDblClick and event.button() == QtCore.Qt.LeftButton:

            self.callbacks.process(self.DOUBLE_CLICK_EVENT, vis.mapMousePosition(obj, event), event.modifiers(), self.imageView)

        if event.type() in (QtCore.QEvent.MouseMove, QtCore.QEvent.MouseButtonPress, QtCore.QEvent.Wheel):
            if self.showCursor:
                self.updateCursor(vis.mapMousePosition(obj, event))
        elif event.type() == QtCore.QEvent.KeyPress:
            if event.key() == QtCore.Qt.Key_Shift:
                self.showCursor = True

        elif event.type() == QtCore.QEvent.KeyRelease:
            if event.key() == QtCore.Qt.Key_Shift:
                self.showCursor = False
                self.hideCursor()

        if event.modifiers() != QtCore.Qt.ShiftModifier:
            if self.annotationObj:
                self.hoverPos = None
                self.draw()
                self.annotationObj.setProperty('Color', [1, 0, 0])
                self.clear()
            return

        if self.annotationObj:
            self.annotationObj.setProperty('Visible', True)

        if event.type() == QtCore.QEvent.MouseMove:
            self.onMouseMove(vis.mapMousePosition(obj, event), event.modifiers())

        elif event.type() == QtCore.QEvent.MouseButtonPress:
            self.onMousePress(vis.mapMousePosition(obj, event), event.modifiers())
 def onEvent(self, obj, event):
     if event.type() == QtCore.QEvent.MouseMove:
         self.onMouseMove(vis.mapMousePosition(obj, event),
                          event.modifiers())
     elif event.type() == QtCore.QEvent.MouseButtonPress:
         self.onMousePress(vis.mapMousePosition(obj, event),
                           event.modifiers())
Beispiel #3
0
    def onEvent(self, obj, event):

        if event.type() == QtCore.QEvent.MouseMove:
            self.onMouseMove(vis.mapMousePosition(obj, event), event.modifiers())
        elif event.type() == QtCore.QEvent.MouseButtonPress and event.button() == QtCore.Qt.LeftButton:
            self.onMousePress(vis.mapMousePosition(obj, event), event.modifiers())
        elif event.type() == QtCore.QEvent.MouseButtonRelease and event.button() == QtCore.Qt.LeftButton:
            self.onMouseRelease(vis.mapMousePosition(obj, event), event.modifiers())
Beispiel #4
0
    def onLeftMousePress(self, event):
        if event.modifiers() == QtCore.Qt.ControlModifier:
            displayPoint = vis.mapMousePosition(self.view, event)
            if footstepsDriver:
                newWalkingGoal(displayPoint, self.view)
                self.consumeEvent()

        for picker in segmentation.viewPickers:
            if not picker.enabled:
                continue

            picker.onMousePress(vis.mapMousePosition(self.view, event), event.modifiers())
            self.consumeEvent()
Beispiel #5
0
    def onEvent(self, obj, event):

        if event.type() == QtCore.QEvent.MouseMove:
            self.onMouseMove(vis.mapMousePosition(obj, event),
                             event.modifiers())
        elif event.type() == QtCore.QEvent.MouseButtonPress and event.button(
        ) == QtCore.Qt.LeftButton:
            self.onMousePress(vis.mapMousePosition(obj, event),
                              event.modifiers())
        elif event.type() == QtCore.QEvent.MouseButtonRelease and event.button(
        ) == QtCore.Qt.LeftButton:
            self.onMouseRelease(vis.mapMousePosition(obj, event),
                                event.modifiers())
Beispiel #6
0
    def onEvent(self, obj, event):

        if event.type() == QtCore.QEvent.KeyPress and event.key() == QtCore.Qt.Key_Escape:
            self.stop()
            self.clear()
            if self.abortFunc is not None:
                self.abortFunc()
            return

        if event.type() == QtCore.QEvent.MouseMove:
            self.onMouseMove(vis.mapMousePosition(obj, event), event.modifiers())
        elif event.type() == QtCore.QEvent.MouseButtonPress:
            self.onMousePress(vis.mapMousePosition(obj, event), event.modifiers())
Beispiel #7
0
    def onEvent(self, obj, event):

        if event.type() == QtCore.QEvent.KeyPress and event.key(
        ) == QtCore.Qt.Key_Escape:
            self.stop()
            self.clear()
            if self.abortFunc is not None:
                self.abortFunc()
            return

        if event.type() == QtCore.QEvent.MouseMove:
            self.onMouseMove(vis.mapMousePosition(obj, event),
                             event.modifiers())
        elif event.type() == QtCore.QEvent.MouseButtonPress:
            self.onMousePress(vis.mapMousePosition(obj, event),
                              event.modifiers())
Beispiel #8
0
    def onMouseMove(self, event):

        for picker in segmentation.viewPickers:
            if not picker.enabled:
                continue

            picker.onMouseMove(vis.mapMousePosition(self.view, event), event.modifiers())
            self.consumeEvent()
Beispiel #9
0
 def filterEvent(self, obj, event):
     if event.type() == QtCore.QEvent.MouseButtonDblClick:
         self.eventFilter.setEventHandlerResult(True)
         self.onViewDoubleClicked(vis.mapMousePosition(obj, event))
     elif event.type() == QtCore.QEvent.KeyPress:
         if str(event.text()).lower() == 'p':
             self.eventFilter.setEventHandlerResult(True)
         elif str(event.text()).lower() == 'r':
             self.eventFilter.setEventHandlerResult(True)
             self.resetCamera()
Beispiel #10
0
 def filterEvent(self, obj, event):
     if event.type() == QtCore.QEvent.MouseButtonDblClick:
         self.eventFilter.setEventHandlerResult(True)
         self.onViewDoubleClicked(vis.mapMousePosition(obj, event))
     elif event.type() == QtCore.QEvent.KeyPress:
         if str(event.text()).lower() == 'p':
             self.eventFilter.setEventHandlerResult(True)
         elif str(event.text()).lower() == 'r':
             self.eventFilter.setEventHandlerResult(True)
             self.resetCamera()
Beispiel #11
0
    def onEvent(self, obj, event):

        if event.type() == QtCore.QEvent.MouseButtonDblClick and event.button(
        ) == QtCore.Qt.LeftButton:

            self.callbacks.process(self.DOUBLE_CLICK_EVENT,
                                   vis.mapMousePosition(obj, event),
                                   event.modifiers(), self.imageView)

        if event.type() in (QtCore.QEvent.MouseMove,
                            QtCore.QEvent.MouseButtonPress,
                            QtCore.QEvent.Wheel):
            if self.showCursor:
                self.updateCursor(vis.mapMousePosition(obj, event))
        elif event.type() == QtCore.QEvent.KeyPress:
            if event.key() == QtCore.Qt.Key_Shift:
                self.showCursor = True

        elif event.type() == QtCore.QEvent.KeyRelease:
            if event.key() == QtCore.Qt.Key_Shift:
                self.showCursor = False
                self.hideCursor()

        if event.modifiers() != QtCore.Qt.ShiftModifier:
            if self.annotationObj:
                self.hoverPos = None
                self.draw()
                self.annotationObj.setProperty('Color', [1, 0, 0])
                self.clear()
            return

        if self.annotationObj:
            self.annotationObj.setProperty('Visible', True)

        if event.type() == QtCore.QEvent.MouseMove:
            self.onMouseMove(vis.mapMousePosition(obj, event),
                             event.modifiers())

        elif event.type() == QtCore.QEvent.MouseButtonPress:
            self.onMousePress(vis.mapMousePosition(obj, event),
                              event.modifiers())
Beispiel #12
0
    def onEvent(self, obj, event):

        if event.type() == QtCore.QEvent.KeyPress and event.key() == QtCore.Qt.Key_Escape:
            self.stop()
            self.clear()
            if self.abortFunc is not None:
                self.abortFunc()
            return

        if event.modifiers() != QtCore.Qt.ShiftModifier:
            if self.annotationObj:
                self.annotationObj.setProperty('Visible', False)
            return

        if self.annotationObj:
            self.annotationObj.setProperty('Visible', True)

        if event.type() == QtCore.QEvent.MouseMove:
            self.onMouseMove(vis.mapMousePosition(obj, event), event.modifiers())
        elif event.type() == QtCore.QEvent.MouseButtonPress:
            self.onMousePress(vis.mapMousePosition(obj, event), event.modifiers())
Beispiel #13
0
    def onLeftDoubleClick(self, event):

        displayPoint = vis.mapMousePosition(self.view, event)

        useHorizontalWidget =  (event.modifiers() == QtCore.Qt.ShiftModifier)
        if toggleFootstepWidget(displayPoint, self.view, useHorizontalWidget):
            return

        if toggleFrameWidget(displayPoint, self.view):
            return

        if robotLinkSelector and robotLinkSelector.selectLink(displayPoint, self.view):
            return
Beispiel #14
0
    def onEvent(self, obj, event):

        if event.type() == QtCore.QEvent.KeyPress and event.key(
        ) == QtCore.Qt.Key_Escape:
            self.stop()
            self.clear()
            if self.abortFunc is not None:
                self.abortFunc()
            return

        if event.modifiers() != QtCore.Qt.ShiftModifier:
            if self.annotationObj:
                self.annotationObj.setProperty('Visible', False)
            return

        if self.annotationObj:
            self.annotationObj.setProperty('Visible', True)

        if event.type() == QtCore.QEvent.MouseMove:
            self.onMouseMove(vis.mapMousePosition(obj, event),
                             event.modifiers())
        elif event.type() == QtCore.QEvent.MouseButtonPress:
            self.onMousePress(vis.mapMousePosition(obj, event),
                              event.modifiers())
Beispiel #15
0
 def onRightClick(self, event):
     displayPoint = vis.mapMousePosition(self.view, event)
     showRightClickMenu(displayPoint, self.view)
Beispiel #16
0
 def onEvent(self, obj, event):
     if event.type() == QtCore.QEvent.MouseMove:
         self.onMouseMove(vis.mapMousePosition(obj, event), event.modifiers())
     elif event.type() == QtCore.QEvent.MouseButtonPress:
         self.onMousePress(vis.mapMousePosition(obj, event), event.modifiers())