Exemple #1
0
    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()