CRIkitUI.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:CRIkit2 作者: CoherentRamanNIST 项目源码 文件源码
def _pointClick(self, event, pass_fcn):
        """
        Capture single mouse click location in MPL window.

        After this function completes, it sends the data (x_pt, y_pt) on to \
        the pass_fcn function.
        """
        if event.button == 1:
            if event.inaxes == self.img_BW.mpl.ax:
                    #self.tempverts += [[event.xdata, event.ydata]]
                x_loc = event.xdata
                y_loc = event.ydata

                # Send on to a function that will use the collected data
                pass_fcn((x_loc, y_loc))

                self.setCursor(_QCursor(_QtCore.Qt.ArrowCursor))
                self.img_BW.mpl.setCursor(_QCursor(_QtCore.Qt.ArrowCursor))
                self.img_BW.mpl.mpl_disconnect(self.cid)
                self.cid = None
            else:  # Clicked out-of-bounds
                pass
#                print('Clicked out-of-bounds')
        else: # Right-or-middle clicked; thus, cancel
            self.setCursor(_QCursor(_QtCore.Qt.ArrowCursor))
            self.img_BW.mpl.setCursor(_QCursor(_QtCore.Qt.ArrowCursor))
            self.img_BW.mpl.mpl_disconnect(self.cid)
            self.cid = None
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号