def prepare_page(self): figkw = { 'fnum': self.fnum, 'doclf': True, 'docla': True, } self.fig = pt.figure(**figkw) ih.disconnect_callback(self.fig, 'button_press_event') ih.connect_callback(self.fig, 'button_press_event', self.figure_clicked)
def prepare_page(self, fulldraw=True): figkw = { 'fnum': self.fnum, 'doclf': fulldraw, 'docla': fulldraw, } if fulldraw: self.fig = pt.figure(**figkw) ih.disconnect_callback(self.fig, 'button_press_event') ih.disconnect_callback(self.fig, 'key_press_event') ih.connect_callback(self.fig, 'button_press_event', self.figure_clicked) ih.connect_callback(self.fig, 'key_press_event', self.on_key_press)
def sv_view(self, dodraw=True): """ spatial verification view """ #fnum = viz.FNUMS['special'] aid = self.daid fnum = pt.next_fnum() fig = pt.figure(fnum=fnum, docla=True, doclf=True) ih.disconnect_callback(fig, 'button_press_event') viz.viz_sver.show_sver(self.ibs, self.qaid, aid2=aid, fnum=fnum) if dodraw: #self.draw() pt.draw()
def _on_chip_click(event): print('[inter] clicked chip') ax, x, y = event.inaxes, event.xdata, event.ydata if ih.clicked_outside_axis(event): if not ischild: print('... out of axis') mode_ptr[0] = (mode_ptr[0] + 1) % 3 _chip_view(**kwargs) else: if event.button == 3: # right-click import guitool_ibeis as gt #from ibeis.viz.interact import interact_chip height = fig.canvas.geometry().height() qpoint = gt.newQPoint(event.x, height - event.y) refresh_func = partial(_chip_view, **kwargs) callback_list = build_annot_context_options( ibs, aid, refresh_func=refresh_func, with_interact_chip=False, config2_=config2_) qwin = fig.canvas gt.popup_menu(qwin, qpoint, callback_list) #interact_chip.show_annot_context_menu( # ibs, aid, fig.canvas, qpoint, refresh_func=refresh_func, # with_interact_chip=False, config2_=config2_) else: viztype = vh.get_ibsdat(ax, 'viztype') print('[ic] viztype=%r' % viztype) if viztype == 'chip' and event.key == 'shift': _chip_view(**kwargs) ih.disconnect_callback(fig, 'button_press_event') elif viztype == 'chip': kpts = ibs.get_annot_kpts(aid, config2_=config2_) if len(kpts) > 0: fx = nearest_point(x, y, kpts, conflict_mode='next')[0] print('... clicked fx=%r' % fx) _select_fxth_kpt(fx) else: print('... len(kpts) == 0') elif viztype in ['warped', 'unwarped']: fx = vh.get_ibsdat(ax, 'fx') if fx is not None and viztype == 'warped': viz.show_keypoint_gradient_orientations( ibs, aid, fx, fnum=pt.next_fnum()) else: print('...Unknown viztype: %r' % viztype) viz.draw()
def dev_reload(self): ih.disconnect_callback(self.fig, 'button_press_event') self.rrr() self.set_callbacks()