Commit 7838ec056c4d68acd86b2b3a7d2501a3a962c47e

Authored by tfmoraes
1 parent 63597fef

ENH: Remove measure in viewer_volume is working

Showing 1 changed file with 8 additions and 0 deletions   Show diff stats
invesalius/data/viewer_volume.py
@@ -143,6 +143,8 @@ class Viewer(wx.Panel): @@ -143,6 +143,8 @@ class Viewer(wx.Panel):
143 'Hide text actors on viewers') 143 'Hide text actors on viewers')
144 144
145 ps.Publisher().subscribe(self.AddActors, ('Add actors', const.SURFACE)) 145 ps.Publisher().subscribe(self.AddActors, ('Add actors', const.SURFACE))
  146 + ps.Publisher().subscribe(self.RemoveActors, ('Remove actors',
  147 + const.SURFACE))
146 148
147 ps.Publisher().subscribe(self.OnShowText, 149 ps.Publisher().subscribe(self.OnShowText,
148 'Show text actors on viewers') 150 'Show text actors on viewers')
@@ -233,6 +235,12 @@ class Viewer(wx.Panel): @@ -233,6 +235,12 @@ class Viewer(wx.Panel):
233 for actor in actors: 235 for actor in actors:
234 self.ren.AddActor(actor) 236 self.ren.AddActor(actor)
235 237
  238 + def RemoveActors(self, pubsub_evt):
  239 + "Remove a list of actors"
  240 + actors = pubsub_evt.data
  241 + for actor in actors:
  242 + self.ren.RemoveActor(actor)
  243 +
236 def AddPointReference(self, position, radius=1, colour=(1, 0, 0)): 244 def AddPointReference(self, position, radius=1, colour=(1, 0, 0)):
237 """ 245 """
238 Add a point representation in the given x,y,z position with a optional 246 Add a point representation in the given x,y,z position with a optional