diff --git a/invesalius/data/viewer_volume.py b/invesalius/data/viewer_volume.py index 4fba86b..0fec3e8 100755 --- a/invesalius/data/viewer_volume.py +++ b/invesalius/data/viewer_volume.py @@ -189,6 +189,9 @@ class Viewer(wx.Panel): Publisher.subscribe(self.RemoveVolume, 'Remove Volume') + Publisher.subscribe(self._check_ball_reference, 'Enable style') + Publisher.subscribe(self._uncheck_ball_reference, 'Disable style') + def SetStereoMode(self, pubsub_evt): mode = pubsub_evt.data ren_win = self.interactor.GetRenderWindow() @@ -255,6 +258,20 @@ class Viewer(wx.Panel): self._mode_cross = False self.RemoveBallReference() + def _check_ball_reference(self, pubsub_evt): + st = pubsub_evt.data + if st == const.SLICE_STATE_CROSS: + self._mode_cross = True + self._check_and_set_ball_visibility() + self.interactor.Render() + + def _uncheck_ball_reference(self, pubsub_evt): + st = pubsub_evt.data + if st == const.SLICE_STATE_CROSS: + self._mode_cross = False + self.RemoveBallReference() + self.interactor.Render() + def OnShowSurface(self, pubsub_evt): index, value = pubsub_evt.data if value: @@ -262,7 +279,6 @@ class Viewer(wx.Panel): else: self._to_show_ball -= 1 self._check_and_set_ball_visibility() - print "OnShowSurface: to show ball", self._to_show_ball def SetBallReferencePosition(self, pubsub_evt): x, y, z = pubsub_evt.data @@ -358,7 +374,6 @@ class Viewer(wx.Panel): self.interactor.Render() self._to_show_ball -= 1 self._check_and_set_ball_visibility() - print "RemoveVolume: to show ball", self._to_show_ball def RemoveActors(self, pubsub_evt): "Remove a list of actors" @@ -408,8 +423,6 @@ class Viewer(wx.Panel): pass def SetInteractorStyle(self, state): - print "SetInteractorStyle" - print "state: ", state action = { const.STATE_PAN: { @@ -646,7 +659,6 @@ class Viewer(wx.Panel): self.raycasting_volume = True self._to_show_ball += 1 self._check_and_set_ball_visibility() - print "OnShowRaycasting: to show ball", self._to_show_ball if self.on_wl: self.text.Show() @@ -655,7 +667,6 @@ class Viewer(wx.Panel): self.text.Hide() self._to_show_ball -= 1 self._check_and_set_ball_visibility() - print "OnHideRaycasting: to show ball", self._to_show_ball def OnSize(self, evt): self.UpdateRender() @@ -686,7 +697,6 @@ class Viewer(wx.Panel): self.interactor.Render() self._to_show_ball += 1 self._check_and_set_ball_visibility() - print "LoadActor: to show ball", self._to_show_ball def RemoveActor(self, pubsub_evt): utils.debug("RemoveActor") @@ -696,7 +706,6 @@ class Viewer(wx.Panel): self.interactor.Render() self._to_show_ball -= 1 self._check_and_set_ball_visibility() - print "to show ball", self._to_show_ball def RemoveAllActor(self, pubsub_evt): utils.debug("RemoveAllActor") @@ -710,7 +719,6 @@ class Viewer(wx.Panel): def LoadVolume(self, pubsub_evt): self.raycasting_volume = True #self._to_show_ball += 1 - #print "to show ball", self._to_show_ball volume = pubsub_evt.data[0] colour = pubsub_evt.data[1] @@ -734,6 +742,7 @@ class Viewer(wx.Panel): self.ren.ResetCamera() self.ren.ResetCameraClippingRange() + self._check_and_set_ball_visibility() self.UpdateRender() def UnloadVolume(self, pubsub_evt): @@ -743,7 +752,6 @@ class Viewer(wx.Panel): self.raycasting_volume = False self._to_show_ball -= 1 self._check_and_set_ball_visibility() - print "UnloadVolume: to show ball", self._to_show_ball def OnSetViewAngle(self, evt_pubsub): view = evt_pubsub.data @@ -819,7 +827,6 @@ class Viewer(wx.Panel): self.interactor.Render() def OnInsertLinearMeasurePoint(self, obj, evt): - print "Hey, you inserted measure point" x,y = self.interactor.GetEventPosition() self.measure_picker.Pick(x, y, 0, self.ren) x, y, z = self.measure_picker.GetPickPosition() @@ -842,7 +849,6 @@ class Viewer(wx.Panel): self.interactor.Render() def OnInsertAngularMeasurePoint(self, obj, evt): - print "Hey, you inserted a angular point" x,y = self.interactor.GetEventPosition() self.measure_picker.Pick(x, y, 0, self.ren) x, y, z = self.measure_picker.GetPickPosition() -- libgit2 0.21.2