Ejemplo n.º 1
0
 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)
Ejemplo n.º 2
0
 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)
Ejemplo n.º 3
0
 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)
Ejemplo n.º 4
0
    def sv_view(self, dodraw=True):
        """ spatial verification view

        """
        #fnum = viz.FNUMS['special']
        aid = self.daid
        fnum = pt.next_fnum()
        fig = df2.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:
            viz.draw()
Ejemplo n.º 5
0
    def sv_view(self, dodraw=True):
        """ spatial verification view

        """
        #fnum = viz.FNUMS['special']
        aid = self.daid
        fnum = pt.next_fnum()
        fig = df2.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:
            viz.draw()
Ejemplo n.º 6
0
 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)
Ejemplo n.º 7
0
    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
                #from ibeis.viz.interact import interact_chip
                height = fig.canvas.geometry().height()
                qpoint = guitool.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
                guitool.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 = vt.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=df2.next_fnum())
                else:
                    print('...Unknown viztype: %r' % viztype)

        viz.draw()
Ejemplo n.º 8
0
    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
                #from ibeis.viz.interact import interact_chip
                height = fig.canvas.geometry().height()
                qpoint = guitool.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
                guitool.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 = vt.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=df2.next_fnum())
                else:
                    print('...Unknown viztype: %r' % viztype)

        viz.draw()
Ejemplo n.º 9
0
 def prepare_page(self, pagenum):
     """ Gets indexes for the pagenum ready to be displayed """
     # Set the start index
     self.start_index = pagenum * self.nPerPage
     # Clip based on nCands
     self.nDisplay = min(self.nCands - self.start_index, self.nPerPage)
     nRows, nCols = ph.get_square_row_cols(self.nDisplay)
     # Create a grid to hold nPerPage
     self.pnum_ = df2.get_pnum_func(nRows, nCols)
     # Adjust stop index
     self.stop_index = self.start_index + self.nDisplay
     # Clear current figure
     self.clean_scope()
     self.fig = df2.figure(fnum=self.fnum, pnum=self.pnum_(0), doclf=True, docla=True)
     ih.disconnect_callback(self.fig, 'button_press_event')
     ih.connect_callback(self.fig, 'button_press_event', self.on_figure_clicked)
Ejemplo n.º 10
0
 def prepare_page(self, pagenum):
     """ Gets indexes for the pagenum ready to be displayed """
     # Set the start index
     self.start_index = pagenum * self.nPerPage
     # Clip based on nCands
     self.nDisplay = min(self.nCands - self.start_index, self.nPerPage)
     nRows, nCols = ph.get_square_row_cols(self.nDisplay)
     # Create a grid to hold nPerPage
     self.pnum_ = df2.get_pnum_func(nRows, nCols)
     # Adjust stop index
     self.stop_index = self.start_index + self.nDisplay
     # Clear current figure
     self.clean_scope()
     self.fig = df2.figure(fnum=self.fnum,
                           pnum=self.pnum_(0),
                           doclf=True,
                           docla=True)
     ih.disconnect_callback(self.fig, 'button_press_event')
     ih.connect_callback(self.fig, 'button_press_event',
                         self.on_figure_clicked)
Ejemplo n.º 11
0
    def prepare_page(self, fulldraw=True):
        import plottool as pt
        ih.disconnect_callback(self.fig, 'button_press_event')
        ih.disconnect_callback(self.fig, 'button_release_event')
        ih.disconnect_callback(self.fig, 'key_press_event')
        ih.disconnect_callback(self.fig, 'motion_notify_event')

        figkw = {'fnum': self.fnum,
                 'doclf': fulldraw,
                 'docla': fulldraw, }
        if fulldraw:
            self.fig = pt.figure(**figkw)
        self.make_hud()
        ih.connect_callback(self.fig, 'button_press_event', self.on_click)
        ih.connect_callback(self.fig, 'button_release_event', self.on_click_release)
        ih.connect_callback(self.fig, 'key_press_event', self.on_key_press)
        ih.connect_callback(self.fig, 'motion_notify_event', self.on_motion)
Ejemplo n.º 12
0
    def prepare_page(self, fulldraw=True):
        import plottool as pt
        ih.disconnect_callback(self.fig, 'button_press_event')
        ih.disconnect_callback(self.fig, 'button_release_event')
        ih.disconnect_callback(self.fig, 'key_press_event')
        ih.disconnect_callback(self.fig, 'motion_notify_event')

        figkw = {
            'fnum': self.fnum,
            'doclf': fulldraw,
            'docla': fulldraw,
        }
        if fulldraw:
            self.fig = pt.figure(**figkw)
        self.make_hud()
        ih.connect_callback(self.fig, 'button_press_event', self.on_click)
        ih.connect_callback(self.fig, 'button_release_event',
                            self.on_click_release)
        ih.connect_callback(self.fig, 'key_press_event', self.on_key_press)
        ih.connect_callback(self.fig, 'motion_notify_event', self.on_motion)
Ejemplo n.º 13
0
 def dev_reload(self):
     ih.disconnect_callback(self.fig, 'button_press_event')
     self.rrr()
     self.set_callbacks()
Ejemplo n.º 14
0
 def _sv_view(aid):
     fnum = viz.FNUMS['special']
     fig = df2.figure(fnum=fnum, docla=True, doclf=True)
     ih.disconnect_callback(fig, 'button_press_event')
     viz.show_sv(ibs, qres.qaid, aid2=aid, fnum=fnum)
     viz.draw()
Ejemplo n.º 15
0
 def dev_reload(self):
     ih.disconnect_callback(self.fig, 'button_press_event')
     self.rrr()
     self.set_callbacks()