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())
Example #2
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())
Example #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())
Example #4
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())
Example #5
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 and event.button() == QtCore.Qt.LeftButton:
            self.onMousePress(vis.mapMousePosition(obj, event), event.modifiers())
Example #6
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()
    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()
Example #8
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())
Example #9
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:
            self.showCursor = False
            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())
Example #10
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()
    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()
Example #12
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()
Example #13
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()
Example #14
0
    def onLeftDoubleClick(self, event):

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

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

        if robotLinkSelector and robotLinkSelector.selectLink(displayPoint, self.view):
            self.consumeEvent()
            return
Example #15
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())
    def onLeftDoubleClick(self, event):

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

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

        if robotLinkSelector and robotLinkSelector.selectLink(
                displayPoint, self.view):
            self.consumeEvent()
            return
Example #17
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())
Example #18
0
 def onRightClick(self, event):
     displayPoint = vis.mapMousePosition(self.view, event)
     showRightClickMenu(displayPoint, self.view)
Example #19
0
 def getMousePositionInView(self, event):
     return vis.mapMousePosition(self.view, event)
Example #20
0
 def getMousePositionInView(self, event):
     return vis.mapMousePosition(self.view, event)
 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())
Example #22
0
    def onLeftDoubleClick(self, event):

        displayPoint = vis.mapMousePosition(self.view, event)
        if toggleFrameWidget(displayPoint, self.view):
            self.consumeEvent()
Example #23
0
 def onRightClick(self, event):
     displayPoint = vis.mapMousePosition(self.view, event)
     showRightClickMenu(displayPoint, self.view)
Example #24
0
    def onLeftDoubleClick(self, event):

        displayPoint = vis.mapMousePosition(self.view, event)
        if toggleFrameWidget(displayPoint, self.view):
            self.consumeEvent()