Skip to content

Commit

Permalink
GUI tables and plot: apply shift on click
Browse files Browse the repository at this point in the history
  • Loading branch information
bkpoon committed Sep 1, 2018
1 parent ca15839 commit 7926d1e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
10 changes: 1 addition & 9 deletions mmtbx/validation/__init__.py
Expand Up @@ -443,8 +443,7 @@ def as_coot_data (self) :
"""
raise NotImplementedError()

def as_gui_table_data(self, outliers_only=True, include_zoom=False,
shift=None):
def as_gui_table_data(self, outliers_only=True, include_zoom=False):
"""
Format results for display in the Phenix GUI.
"""
Expand All @@ -453,13 +452,6 @@ def as_gui_table_data(self, outliers_only=True, include_zoom=False,
extra = []
if (include_zoom) :
extra = result.zoom_info()
if (shift is not None):
assert(len(shift) == 3)
xyz = extra[-1]
xyz = (xyz[0] + shift[0],
xyz[1] + shift[1],
xyz[2] + shift[2])
extra[1] = xyz
row = result.as_table_row_phenix()
assert (len(row) == len(self.gui_list_headers))
table.append(row + extra)
Expand Down
10 changes: 8 additions & 2 deletions wxtbx/plots/molprobity.py
Expand Up @@ -12,11 +12,12 @@
class rotarama_plot (wxtbx.plots.plot_container) :
hit_test_radius = 3.0
hit_test_minimum_difference = 0.5
def __init__ (self, parent, figure_size=(8,8)) :
def __init__ (self, parent, figure_size=(8,8), xyz_shift=None) :
wxtbx.plots.plot_container.__init__(self,
parent=parent,
figure_size=figure_size,
handle_left_click=True)
self.xyz_shift = xyz_shift

def show_plot (self, *args, **kwds) :
if self.disabled : return
Expand All @@ -35,7 +36,12 @@ def process_mouse_click (self, mpl_event) :
closest_point = i
min_dist = dist
if closest_point is not None :
self.parent.zoom_callback(xyz=self._xyz[closest_point])
xyz = self._xyz[closest_point]
if (self.xyz_shift is not None):
xyz = (xyz[0] + self.xyz_shift[0],
xyz[1] + self.xyz_shift[1],
xyz[2] + self.xyz_shift[2])
self.parent.zoom_callback(xyz=xyz)

class ramalyze_plot (rotarama_plot,
ramalyze.ramachandran_plot_mixin) :
Expand Down

0 comments on commit 7926d1e

Please sign in to comment.