当前位置: 首页>>代码示例>>Python>>正文


Python QVTKRenderWindowInteractor.mousePressEvent方法代码示例

本文整理汇总了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()
开发者ID:behollis,项目名称:DBSViewer,代码行数:44,代码来源:dbsInteractor.py


注:本文中的vtk.qt4.QVTKRenderWindowInteractor.QVTKRenderWindowInteractor.mousePressEvent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。