本文整理汇总了Python中vtk.qt4.QVTKRenderWindowInteractor.QVTKRenderWindowInteractor.mousePressEvent方法的典型用法代码示例。如果您正苦于以下问题:Python QVTKRenderWindowInteractor.mousePressEvent方法的具体用法?Python QVTKRenderWindowInteractor.mousePressEvent怎么用?Python QVTKRenderWindowInteractor.mousePressEvent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vtk.qt4.QVTKRenderWindowInteractor.QVTKRenderWindowInteractor
的用法示例。
在下文中一共展示了QVTKRenderWindowInteractor.mousePressEvent方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: mouseDoubleClickEvent
# 需要导入模块: from vtk.qt4.QVTKRenderWindowInteractor import QVTKRenderWindowInteractor [as 别名]
# 或者: from vtk.qt4.QVTKRenderWindowInteractor.QVTKRenderWindowInteractor import mousePressEvent [as 别名]
def mouseDoubleClickEvent(self, ev):
picker = self.GetRenderWindow().GetInteractor().GetPicker()
# Get the location of the click (in window coordinates)
pos = self.GetRenderWindow().GetInteractor().GetEventPosition()
#picker.SetTolerance(0.0005)
picker.Pick( pos[0], pos[1], 0, self.GetRenderWindow().GetRenderers().GetFirstRenderer() )
#print 'Cell id is: ' + str( picker.GetCellId() )
#print 'Point id is: ' + str( picker.GetPointId() )
actors = picker.GetActors()
screenPos = picker.GetSelectionPoint()
worldPosition = picker.GetPickPosition()
data = picker.GetDataSet()
'''
print pickPos
print screenPos
print actors
print actors.GetLastItem()
'''
#print 'data: ' + str( data )
self.__addVolumeSelectedActor(worldPosition)
av = self.app.active_vol
cellid = picker.GetPointId()
#if self._graph is not None and cellid != -1 :
try:
self._graph.update_figure( cellid, self._scoresim, self._scores, \
self.app._vdata[av].pt_id_ijk, \
self.pat_data_img_data_list, radius=self.pick_radius )
except:
pass
QVTKRenderWindowInteractor.mousePressEvent(self, ev)
self.update()