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())
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 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())
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())
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())
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 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())
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())
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 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()
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()
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
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
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 onRightClick(self, event): displayPoint = vis.mapMousePosition(self.view, event) showRightClickMenu(displayPoint, self.view)
def getMousePositionInView(self, event): return vis.mapMousePosition(self.view, event)
def onLeftDoubleClick(self, event): displayPoint = vis.mapMousePosition(self.view, event) if toggleFrameWidget(displayPoint, self.view): self.consumeEvent()