From 29ad776e5e16c3b080a5a5b8bce344445794237c Mon Sep 17 00:00:00 2001 From: tatiana Date: Tue, 18 Aug 2009 20:46:52 +0000 Subject: [PATCH] FIX: In process of arranging insertion of plane in raycasting --- invesalius/data/volume.py | 7 +++++-- invesalius/gui/default_viewers.py | 29 +++++++++++------------------ 2 files changed, 16 insertions(+), 20 deletions(-) diff --git a/invesalius/data/volume.py b/invesalius/data/volume.py index 4c23990..03590e5 100755 --- a/invesalius/data/volume.py +++ b/invesalius/data/volume.py @@ -465,9 +465,12 @@ class Volume(): ps.Publisher().sendMessage('Load volume into viewer', (volume, colour)) def OnEnableTool(self, pubsub_evt): - tool_name = pubsub_evt.data + tool_name, enable = pubsub_evt.data if tool_name == "Cut plane": - plane = CutPlane(self.final_imagedata, self.volume_mapper) + if enable: + plane = CutPlane(self.final_imagedata, self.volume_mapper) + else: + print "TODO: Desabilitar plano" def TranslateScale(self, scale, value): #if value < 0: diff --git a/invesalius/gui/default_viewers.py b/invesalius/gui/default_viewers.py index e2e29b0..521f8ce 100755 --- a/invesalius/gui/default_viewers.py +++ b/invesalius/gui/default_viewers.py @@ -288,20 +288,25 @@ class VolumeToolPanel(wx.Panel): """Events from raycasting menu.""" id = evt.GetId() if id in ID_TO_NAME.keys(): + # Raycassting type was selected name = ID_TO_NAME[evt.GetId()] ps.Publisher().sendMessage('Load raycasting preset', ID_TO_NAME[evt.GetId()]) + # Enable or disable tools if name != const.RAYCASTING_OFF_LABEL: - self.menu_raycasting.Enable(RAYCASTING_TOOLS, 1) + self.menu_raycasting.Enable(RAYCASTING_TOOLS, 1) else: self.menu_raycasting.Enable(RAYCASTING_TOOLS, 0) + else: + # Raycasting tool + # TODO: In future, when more tools are available item = ID_TO_TOOL_ITEM[evt.GetId()] - if not item.IsChecked(): - for i in ID_TO_TOOL_ITEM.values(): - if i is not item: - i.Check(0) - + #if not item.IsChecked(): + # for i in ID_TO_TOOL_ITEM.values(): + # if i is not item: + # i.Check(0) + if item.IsChecked(): ps.Publisher().sendMessage('Enable raycasting tool', [ID_TO_TOOL[evt.GetId()],1]) else: @@ -321,15 +326,3 @@ class VolumeToolPanel(wx.Panel): colour = c = [i/255.0 for i in evt.GetValue()] ps.Publisher().sendMessage('Change volume viewer background colour', colour) - #def OnToggleRaycasting(self, evt): - # print "oi" - # if self.button_raycasting_toggle: - # ps.Publisher().sendMessage('Hide raycasting volume') - # self.button_raycasting.SetBackgroundColour(self.GetParent().GetBackgroundColour()) - # #self.button_raycasting.SetBitmapSelected(ID_TO_BMP2[0]) - # self.button_raycasting_toggle = 0 - # else: - # ps.Publisher().sendMessage('Show raycasting volume') - # self.button_raycasting_toggle = 1 - # #self.button_raycasting.SetBitmapSelected(ID_TO_BMP2[1]) - # self.button_raycasting.SetBackgroundColour((255,255,255)) -- libgit2 0.21.2