Commit f2330bfef697a36cb8483da1780a30783f44e9b1
1 parent
8728b0e3
Exists in
master
and in
6 other branches
ENH: Improving of the code
Showing
1 changed file
with
6 additions
and
5 deletions
Show diff stats
invesalius/data/viewer_volume.py
@@ -319,7 +319,11 @@ class SlicePlane: | @@ -319,7 +319,11 @@ class SlicePlane: | ||
319 | project = prj.Project() | 319 | project = prj.Project() |
320 | self.original_orientation = project.original_orientation | 320 | self.original_orientation = project.original_orientation |
321 | self.Create() | 321 | self.Create() |
322 | - | 322 | + self.__bind_evt() |
323 | + | ||
324 | + def __bind_evt(self): | ||
325 | + ps.Publisher().subscribe(self.Enable, 'Enable plane') | ||
326 | + ps.Publisher().subscribe(self.Disable, 'Disable plane') | ||
323 | 327 | ||
324 | def Create(self): | 328 | def Create(self): |
325 | 329 | ||
@@ -386,10 +390,7 @@ class SlicePlane: | @@ -386,10 +390,7 @@ class SlicePlane: | ||
386 | ps.Publisher().sendMessage('Set Widget Interactor', plane_x) | 390 | ps.Publisher().sendMessage('Set Widget Interactor', plane_x) |
387 | ps.Publisher().sendMessage('Set Widget Interactor', plane_y) | 391 | ps.Publisher().sendMessage('Set Widget Interactor', plane_y) |
388 | ps.Publisher().sendMessage('Set Widget Interactor', plane_z) | 392 | ps.Publisher().sendMessage('Set Widget Interactor', plane_z) |
389 | - | ||
390 | - ps.Publisher().subscribe(self.Enable, 'Enable plane') | ||
391 | - ps.Publisher().subscribe(self.Disable, 'Disable plane') | ||
392 | - | 393 | + |
393 | self.Enable() | 394 | self.Enable() |
394 | self.Disable() | 395 | self.Disable() |
395 | 396 |