Skip to content

Commit

Permalink
MOD: Maximize volume viewer when starting navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
henrikkauppi committed Nov 15, 2024
1 parent c6eb69a commit 0c64623
Showing 1 changed file with 19 additions and 8 deletions.
27 changes: 19 additions & 8 deletions invesalius/gui/default_viewers.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,18 +158,29 @@ def __bind_events_wx(self):
self.aui_manager.Bind(wx.aui.EVT_AUI_PANE_RESTORE, self.OnRestore)

def __bind_events(self):
Publisher.subscribe(self.MaximizeViewerVolume, "Set target mode")
Publisher.subscribe(self.OnSetTargetMode, "Set target mode")
Publisher.subscribe(self.OnStartNavigation, "Start navigation")
Publisher.subscribe(self._Exit, "Exit")

def MaximizeViewerVolume(self, enabled=True):
def OnSetTargetMode(self, enabled=True):
if enabled:
self.aui_manager.MaximizePane(
self.aui_manager.GetAllPanes()[-1]
) # Viewer volume is the last pane
Publisher.sendMessage("Show raycasting widget")
self.MaximizeViewerVolume()
else:
self.aui_manager.RestoreMaximizedPane()
Publisher.sendMessage("Hide raycasting widget")
self.RestoreViewerVolume()

def OnStartNavigation(self):
self.MaximizeViewerVolume()

def RestoreViewerVolume(self):
self.aui_manager.RestoreMaximizedPane()
Publisher.sendMessage("Hide raycasting widget")
self.aui_manager.Update()

def MaximizeViewerVolume(self):
self.aui_manager.MaximizePane(
self.aui_manager.GetAllPanes()[-1]
) # Viewer volume is the last pane
Publisher.sendMessage("Show raycasting widget")
self.aui_manager.Update()

def OnMaximize(self, evt):
Expand Down

0 comments on commit 0c64623

Please sign in to comment.