Commit aebc68be9a7b53911799e1c8b55ee72048e5b938

Authored by Paulo Henrique Junqueira Amorim
1 parent 4701ce10

ENH: Change slice from 3D plane to event release of the scroll, because the prob…

…lem of slow, when there is volume.
Showing 1 changed file with 8 additions and 3 deletions   Show diff stats
invesalius/data/viewer_slice.py
@@ -720,6 +720,7 @@ class Viewer(wx.Panel): @@ -720,6 +720,7 @@ class Viewer(wx.Panel):
720 720
721 def __bind_events_wx(self): 721 def __bind_events_wx(self):
722 self.scroll.Bind(wx.EVT_SCROLL, self.OnScrollBar) 722 self.scroll.Bind(wx.EVT_SCROLL, self.OnScrollBar)
  723 + self.scroll.Bind(wx.EVT_SCROLL_ENDSCROLL, self.OnScrollBarRelease)
723 self.interactor.Bind(wx.EVT_KEY_DOWN, self.OnKeyDown) 724 self.interactor.Bind(wx.EVT_KEY_DOWN, self.OnKeyDown)
724 self.interactor.Bind(wx.EVT_CONTEXT_MENU, self.OnContextMenu) 725 self.interactor.Bind(wx.EVT_CONTEXT_MENU, self.OnContextMenu)
725 726
@@ -1024,13 +1025,17 @@ class Viewer(wx.Panel): @@ -1024,13 +1025,17 @@ class Viewer(wx.Panel):
1024 elif(self.orientation == "AXIAL") and \ 1025 elif(self.orientation == "AXIAL") and \
1025 (original_orientation == const.SAGITAL): 1026 (original_orientation == const.SAGITAL):
1026 pos = abs(self.scroll.GetRange() - pos) 1027 pos = abs(self.scroll.GetRange() - pos)
1027 -  
1028 - ps.Publisher().sendMessage('Change slice from slice plane',\  
1029 - (self.orientation, pos)) 1028 +
  1029 + self.pos = pos
1030 self.cursor_.Show(1) 1030 self.cursor_.Show(1)
1031 self.interactor.Render() 1031 self.interactor.Render()
1032 if evt: 1032 if evt:
1033 evt.Skip() 1033 evt.Skip()
  1034 +
  1035 + def OnScrollBarRelease(self, evt):
  1036 + ps.Publisher().sendMessage('Change slice from slice plane',\
  1037 + (self.orientation, self.pos))
  1038 +
1034 1039
1035 def OnKeyDown(self, evt=None): 1040 def OnKeyDown(self, evt=None):
1036 pos = self.scroll.GetThumbPosition() 1041 pos = self.scroll.GetThumbPosition()