Commit b40d0901c1ffa00627db09a162b5cdbb737cc7cb
1 parent
63585d7d
Exists in
master
and in
6 other branches
ENH: Showing and hidding measures
Showing
1 changed file
with
6 additions
and
0 deletions
Show diff stats
invesalius/data/measures.py
@@ -31,6 +31,7 @@ class MeasurementManager(object): | @@ -31,6 +31,7 @@ class MeasurementManager(object): | ||
31 | 31 | ||
32 | def _bind_events(self): | 32 | def _bind_events(self): |
33 | ps.Publisher().subscribe(self._add_point, "Add measurement point") | 33 | ps.Publisher().subscribe(self._add_point, "Add measurement point") |
34 | + ps.Publisher().subscribe(self._set_visibility, "Show measurement") | ||
34 | 35 | ||
35 | def _add_point(self, pubsub_evt): | 36 | def _add_point(self, pubsub_evt): |
36 | position = pubsub_evt.data[0] | 37 | position = pubsub_evt.data[0] |
@@ -82,6 +83,11 @@ class MeasurementManager(object): | @@ -82,6 +83,11 @@ class MeasurementManager(object): | ||
82 | value)) | 83 | value)) |
83 | self.current = None | 84 | self.current = None |
84 | 85 | ||
86 | + def _set_visibility(self, pubsub_evt): | ||
87 | + index, visibility = pubsub_evt.data | ||
88 | + m, mr = self.measures[index] | ||
89 | + m.is_shown = visibility | ||
90 | + mr.SetVisibility(visibility) | ||
85 | 91 | ||
86 | 92 | ||
87 | class Measurement(): | 93 | class Measurement(): |