Commit f2330bfef697a36cb8483da1780a30783f44e9b1

Authored by Paulo Henrique Junqueira Amorim
1 parent 8728b0e3

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 319 project = prj.Project()
320 320 self.original_orientation = project.original_orientation
321 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 328 def Create(self):
325 329  
... ... @@ -386,10 +390,7 @@ class SlicePlane:
386 390 ps.Publisher().sendMessage('Set Widget Interactor', plane_x)
387 391 ps.Publisher().sendMessage('Set Widget Interactor', plane_y)
388 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 394 self.Enable()
394 395 self.Disable()
395 396  
... ...