Commit 994b42f7283e80459b78b3d6a0f7e50071522ea2
1 parent
c6f28051
Exists in
master
and in
26 other branches
renaming is_shown to visible in the measurements
Showing
4 changed files
with
8 additions
and
6 deletions
Show diff stats
invesalius/data/measures.py
@@ -137,7 +137,7 @@ class MeasurementManager(object): | @@ -137,7 +137,7 @@ class MeasurementManager(object): | ||
137 | (actors, m.slice_number)) | 137 | (actors, m.slice_number)) |
138 | self.current = None | 138 | self.current = None |
139 | 139 | ||
140 | - if not m.is_shown: | 140 | + if not m.visible: |
141 | mr.SetVisibility(False) | 141 | mr.SetVisibility(False) |
142 | if m.location == const.SURFACE: | 142 | if m.location == const.SURFACE: |
143 | Publisher.sendMessage('Render volume viewer') | 143 | Publisher.sendMessage('Render volume viewer') |
@@ -307,7 +307,7 @@ class MeasurementManager(object): | @@ -307,7 +307,7 @@ class MeasurementManager(object): | ||
307 | def _set_visibility(self, pubsub_evt): | 307 | def _set_visibility(self, pubsub_evt): |
308 | index, visibility = pubsub_evt.data | 308 | index, visibility = pubsub_evt.data |
309 | m, mr = self.measures[index] | 309 | m, mr = self.measures[index] |
310 | - m.is_shown = visibility | 310 | + m.visible = visibility |
311 | mr.SetVisibility(visibility) | 311 | mr.SetVisibility(visibility) |
312 | if m.location == const.SURFACE: | 312 | if m.location == const.SURFACE: |
313 | Publisher.sendMessage('Render volume viewer') | 313 | Publisher.sendMessage('Render volume viewer') |
@@ -349,7 +349,7 @@ class Measurement(): | @@ -349,7 +349,7 @@ class Measurement(): | ||
349 | self.type = const.LINEAR # ANGULAR | 349 | self.type = const.LINEAR # ANGULAR |
350 | self.slice_number = 0 | 350 | self.slice_number = 0 |
351 | self.points = [] | 351 | self.points = [] |
352 | - self.is_shown = True | 352 | + self.visible = True |
353 | 353 | ||
354 | def Load(self, info): | 354 | def Load(self, info): |
355 | self.index = info["index"] | 355 | self.index = info["index"] |
@@ -360,7 +360,7 @@ class Measurement(): | @@ -360,7 +360,7 @@ class Measurement(): | ||
360 | self.type = info["type"] | 360 | self.type = info["type"] |
361 | self.slice_number = info["slice_number"] | 361 | self.slice_number = info["slice_number"] |
362 | self.points = info["points"] | 362 | self.points = info["points"] |
363 | - self.is_shown = info["visible"] | 363 | + self.visible = info["visible"] |
364 | 364 | ||
365 | class CirclePointRepresentation(object): | 365 | class CirclePointRepresentation(object): |
366 | """ | 366 | """ |
invesalius/data/viewer_slice.py
@@ -218,6 +218,8 @@ class CanvasRendererCTX: | @@ -218,6 +218,8 @@ class CanvasRendererCTX: | ||
218 | 218 | ||
219 | for (m, mr) in self.viewer.measures.get(self.viewer.orientation, self.viewer.slice_data.number): | 219 | for (m, mr) in self.viewer.measures.get(self.viewer.orientation, self.viewer.slice_data.number): |
220 | lines = [] | 220 | lines = [] |
221 | + if not m.visible: | ||
222 | + continue | ||
221 | for p in m.points: | 223 | for p in m.points: |
222 | coord.SetValue(p) | 224 | coord.SetValue(p) |
223 | cx, cy = coord.GetComputedDisplayValue(self.viewer.slice_data.renderer) | 225 | cx, cy = coord.GetComputedDisplayValue(self.viewer.slice_data.renderer) |
invesalius/gui/data_notebook.py
@@ -1105,7 +1105,7 @@ class MeasuresListCtrlPanel(wx.ListCtrl, listmix.TextEditMixin): | @@ -1105,7 +1105,7 @@ class MeasuresListCtrlPanel(wx.ListCtrl, listmix.TextEditMixin): | ||
1105 | value = (u"%.2f°") % m.value | 1105 | value = (u"%.2f°") % m.value |
1106 | self.InsertNewItem(m.index, m.name, colour, location, type, value) | 1106 | self.InsertNewItem(m.index, m.name, colour, location, type, value) |
1107 | 1107 | ||
1108 | - if not m.is_shown: | 1108 | + if not m.visible: |
1109 | self.SetItemImage(i, False) | 1109 | self.SetItemImage(i, False) |
1110 | 1110 | ||
1111 | def AddItem_(self, pubsub_evt): | 1111 | def AddItem_(self, pubsub_evt): |
invesalius/project.py
@@ -190,7 +190,7 @@ class Project(object): | @@ -190,7 +190,7 @@ class Project(object): | ||
190 | item["type"] = m.type | 190 | item["type"] = m.type |
191 | item["slice_number"] = m.slice_number | 191 | item["slice_number"] = m.slice_number |
192 | item["points"] = m.points | 192 | item["points"] = m.points |
193 | - item["visible"] = m.is_shown | 193 | + item["visible"] = m.visible |
194 | measures[str(m.index)] = item | 194 | measures[str(m.index)] = item |
195 | return measures | 195 | return measures |
196 | 196 |