From c614e7ac2be8e21980c95fe606f1b35f64231a79 Mon Sep 17 00:00:00 2001 From: Thiago Franco de Moraes Date: Wed, 31 Oct 2012 16:59:47 -0200 Subject: [PATCH] Added support undo/redo mask without generating a new history --- invesalius/data/slice_.py | 8 ++++++++ 1 file changed, 8 insertions(+), 0 deletions(-) diff --git a/invesalius/data/slice_.py b/invesalius/data/slice_.py index 44fe4ac..8dae1a7 100644 --- a/invesalius/data/slice_.py +++ b/invesalius/data/slice_.py @@ -109,6 +109,8 @@ class Slice(object): 'Set edition threshold values') Publisher.subscribe(self.__set_current_mask_threshold, 'Set threshold values') + Publisher.subscribe(self.__set_current_mask_threshold_no_history, + 'Set threshold values no history') Publisher.subscribe(self.__set_current_mask_threshold_actual_slice, 'Changing threshold values') Publisher.subscribe(self.__set_current_mask_colour, @@ -278,6 +280,12 @@ class Slice(object): self.current_mask.save_threshold_history(threshold_range) + def __set_current_mask_threshold_no_history(self, evt_pubsub): + threshold_range = evt_pubsub.data + index = self.current_mask.index + self.num_gradient += 1 + self.current_mask.matrix[:] = 0 + def __set_current_mask_threshold_actual_slice(self, evt_pubsub): threshold_range = evt_pubsub.data index = self.current_mask.index -- libgit2 0.21.2