def mousePressEvent(self, e): if e.type() == QEvent.MouseButtonDblClick: logger.debug( "double clicked" ) #self.picker.SetTolerance(0.05) picker = vtkCellPicker() picker.SetTolerance(0.05) res = picker.Pick(e.pos().x(), e.pos().y(), 0, self.renderer) if res > 0: c = picker.GetPickPosition() logger.debug( " picked at coordinate = {}".format( c ) ) self.emit(SIGNAL("objectPicked"), c[0:3]) else: QVTKWidget2.mousePressEvent(self, e)
def mousePressEvent(self, e): if e.type() == QEvent.MouseButtonDblClick: print "double clicked" #self.picker.SetTolerance(0.05) picker = vtkCellPicker() picker.SetTolerance(0.05) res = picker.Pick(e.pos().x(), e.pos().y(), 0, self.renderer) if res > 0: c = picker.GetPickPosition() print " picked at coordinate =", c self.emit(SIGNAL("objectPicked"), c[0:3]) else: QVTKWidget2.mousePressEvent(self, e)
def update(self): QVTKWidget2.update(self) #Refresh the content, works around a bug on OS X self.paintGL()
def __init__(self, parent = None): QVTKWidget2.__init__(self, parent)
def __init__(self, parent=None): QVTKWidget2.__init__(self, parent)