Commit 918c8c2bafeedc1331b94e1a3978da95f7b31b16
1 parent
304995de
Exists in
master
and in
6 other branches
FIX: Show/hide surfaces based on inv3
Showing
3 changed files
with
13 additions
and
1 deletions
Show diff stats
invesalius/control.py
... | ... | @@ -351,6 +351,8 @@ class Controller(): |
351 | 351 | ps.Publisher().sendMessage('Set project name', proj.name) |
352 | 352 | ps.Publisher().sendMessage('Load surface dict', |
353 | 353 | proj.surface_dict) |
354 | + ps.Publisher().sendMessage('Hide surface items', | |
355 | + proj.surface_dict) | |
354 | 356 | self.LoadImagedataInfo() # TODO: where do we insert this <<<? |
355 | 357 | ps.Publisher().sendMessage('Show content panel') |
356 | 358 | ps.Publisher().sendMessage('Update AUI') | ... | ... |
invesalius/data/surface.py
... | ... | @@ -363,6 +363,8 @@ class SurfaceManager(): |
363 | 363 | (surface.index, surface.name, |
364 | 364 | surface.colour, surface.volume, |
365 | 365 | surface.transparency)) |
366 | + if not surface.is_shown: | |
367 | + self.ShowActor(key, False) | |
366 | 368 | |
367 | 369 | #### |
368 | 370 | #(mask_index, surface_name, quality, fill_holes, keep_largest) | ... | ... |
invesalius/gui/data_notebook.py
... | ... | @@ -686,7 +686,7 @@ class SurfacesListCtrlPanel(wx.ListCtrl, listmix.TextEditMixin): |
686 | 686 | ps.Publisher().subscribe(self.EditSurfaceColour, |
687 | 687 | 'Set surface colour') |
688 | 688 | ps.Publisher().subscribe(self.OnCloseProject, 'Close project data') |
689 | - | |
689 | + ps.Publisher().subscribe(self.OnHideSurface, 'Hide surface items') | |
690 | 690 | |
691 | 691 | ps.Publisher().subscribe(self.OnShowSingle, 'Show single surface') |
692 | 692 | ps.Publisher().subscribe(self.OnShowMultiple, 'Show multiple surfaces') |
... | ... | @@ -706,6 +706,14 @@ class SurfacesListCtrlPanel(wx.ListCtrl, listmix.TextEditMixin): |
706 | 706 | elif (keycode == wx.WXK_DELETE): |
707 | 707 | self.RemoveSurfaces() |
708 | 708 | |
709 | + | |
710 | + def OnHideSurface(self, pubsub_evt): | |
711 | + surface_dict = pubsub_evt.data | |
712 | + for key in surface_dict: | |
713 | + if not surface_dict[key].is_shown: | |
714 | + self.SetItemImage(key, False) | |
715 | + | |
716 | + | |
709 | 717 | def RemoveSurfaces(self): |
710 | 718 | """ |
711 | 719 | Remove item given its index. | ... | ... |