Commit 29ad776e5e16c3b080a5a5b8bce344445794237c
1 parent
9055b1d5
Exists in
master
and in
68 other branches
FIX: In process of arranging insertion of plane in raycasting
Showing
2 changed files
with
16 additions
and
20 deletions
Show diff stats
invesalius/data/volume.py
... | ... | @@ -465,9 +465,12 @@ class Volume(): |
465 | 465 | ps.Publisher().sendMessage('Load volume into viewer', (volume, colour)) |
466 | 466 | |
467 | 467 | def OnEnableTool(self, pubsub_evt): |
468 | - tool_name = pubsub_evt.data | |
468 | + tool_name, enable = pubsub_evt.data | |
469 | 469 | if tool_name == "Cut plane": |
470 | - plane = CutPlane(self.final_imagedata, self.volume_mapper) | |
470 | + if enable: | |
471 | + plane = CutPlane(self.final_imagedata, self.volume_mapper) | |
472 | + else: | |
473 | + print "TODO: Desabilitar plano" | |
471 | 474 | |
472 | 475 | def TranslateScale(self, scale, value): |
473 | 476 | #if value < 0: | ... | ... |
invesalius/gui/default_viewers.py
... | ... | @@ -288,20 +288,25 @@ class VolumeToolPanel(wx.Panel): |
288 | 288 | """Events from raycasting menu.""" |
289 | 289 | id = evt.GetId() |
290 | 290 | if id in ID_TO_NAME.keys(): |
291 | + # Raycassting type was selected | |
291 | 292 | name = ID_TO_NAME[evt.GetId()] |
292 | 293 | ps.Publisher().sendMessage('Load raycasting preset', |
293 | 294 | ID_TO_NAME[evt.GetId()]) |
295 | + # Enable or disable tools | |
294 | 296 | if name != const.RAYCASTING_OFF_LABEL: |
295 | - self.menu_raycasting.Enable(RAYCASTING_TOOLS, 1) | |
297 | + self.menu_raycasting.Enable(RAYCASTING_TOOLS, 1) | |
296 | 298 | else: |
297 | 299 | self.menu_raycasting.Enable(RAYCASTING_TOOLS, 0) |
300 | + | |
298 | 301 | else: |
302 | + # Raycasting tool | |
303 | + # TODO: In future, when more tools are available | |
299 | 304 | item = ID_TO_TOOL_ITEM[evt.GetId()] |
300 | - if not item.IsChecked(): | |
301 | - for i in ID_TO_TOOL_ITEM.values(): | |
302 | - if i is not item: | |
303 | - i.Check(0) | |
304 | - | |
305 | + #if not item.IsChecked(): | |
306 | + # for i in ID_TO_TOOL_ITEM.values(): | |
307 | + # if i is not item: | |
308 | + # i.Check(0) | |
309 | + if item.IsChecked(): | |
305 | 310 | ps.Publisher().sendMessage('Enable raycasting tool', |
306 | 311 | [ID_TO_TOOL[evt.GetId()],1]) |
307 | 312 | else: |
... | ... | @@ -321,15 +326,3 @@ class VolumeToolPanel(wx.Panel): |
321 | 326 | colour = c = [i/255.0 for i in evt.GetValue()] |
322 | 327 | ps.Publisher().sendMessage('Change volume viewer background colour', colour) |
323 | 328 | |
324 | - #def OnToggleRaycasting(self, evt): | |
325 | - # print "oi" | |
326 | - # if self.button_raycasting_toggle: | |
327 | - # ps.Publisher().sendMessage('Hide raycasting volume') | |
328 | - # self.button_raycasting.SetBackgroundColour(self.GetParent().GetBackgroundColour()) | |
329 | - # #self.button_raycasting.SetBitmapSelected(ID_TO_BMP2[0]) | |
330 | - # self.button_raycasting_toggle = 0 | |
331 | - # else: | |
332 | - # ps.Publisher().sendMessage('Show raycasting volume') | |
333 | - # self.button_raycasting_toggle = 1 | |
334 | - # #self.button_raycasting.SetBitmapSelected(ID_TO_BMP2[1]) | |
335 | - # self.button_raycasting.SetBackgroundColour((255,255,255)) | ... | ... |