diff --git a/invesalius/constants.py b/invesalius/constants.py index 51728ef..98a44eb 100644 --- a/invesalius/constants.py +++ b/invesalius/constants.py @@ -428,11 +428,16 @@ STATE_SPIN = 1002 STATE_ZOOM = 1003 STATE_ZOOM_SL = 1004 STATE_PAN = 1005 -SLICE_STATE_CROSS = 1006 -SLICE_STATE_SCROLL = 1007 -SLICE_STATE_EDITOR = 1008 +STATE_ANNOTATE = 1006 +STATE_MEASURE_DISTANCE = 1007 +STATE_MEASURE_ANGLE = 1008 + +SLICE_STATE_CROSS = 3006 +SLICE_STATE_SCROLL = 3007 +SLICE_STATE_EDITOR = 3008 + VOLUME_STATE_SEED = 2001 -STATE_LINEAR_MEASURE = 3001 +#STATE_LINEAR_MEASURE = 3001 TOOL_STATES = [ STATE_WL, STATE_SPIN, STATE_ZOOM, @@ -445,18 +450,20 @@ SLICE_STYLES = TOOL_STATES + TOOL_SLICE_STATES SLICE_STYLES.append(STATE_DEFAULT) SLICE_STYLES.append(SLICE_STATE_EDITOR) -VOLUME_STYLES = TOOL_STATES + [VOLUME_STATE_SEED, STATE_LINEAR_MEASURE] +VOLUME_STYLES = TOOL_STATES + [VOLUME_STATE_SEED, STATE_MEASURE_DISTANCE] VOLUME_STYLES.append(STATE_DEFAULT) STYLE_LEVEL = {SLICE_STATE_EDITOR: 1, SLICE_STATE_CROSS: 2, SLICE_STATE_SCROLL: 2, + STATE_ANNOTATE: 2, STATE_DEFAULT: 0, + STATE_MEASURE_ANGLE: 2, + STATE_MEASURE_DISTANCE: 2, STATE_WL: 2, STATE_SPIN: 2, STATE_ZOOM: 2, STATE_ZOOM_SL: 2, STATE_PAN:2, - VOLUME_STATE_SEED:1, - STATE_LINEAR_MEASURE: 2} + VOLUME_STATE_SEED:1} diff --git a/invesalius/data/viewer_volume.py b/invesalius/data/viewer_volume.py index 93999a3..dcf2b28 100755 --- a/invesalius/data/viewer_volume.py +++ b/invesalius/data/viewer_volume.py @@ -262,6 +262,8 @@ class Viewer(wx.Panel): pass def SetInteractorStyle(self, state): + print "SetInteractorStyle" + print "state: ", state action = { const.STATE_PAN: { @@ -294,7 +296,7 @@ class Viewer(wx.Panel): { "LeftButtonPressEvent": self.OnInsertSeed }, - const.STATE_LINEAR_MEASURE: + const.STATE_MEASURE_DISTANCE: { "LeftButtonPressEvent": self.OnInsertLinearMeasurePoint } @@ -310,6 +312,9 @@ class Viewer(wx.Panel): self.text.Hide() self.interactor.Render() + if state == const.STATE_MEASURE_DISTANCE: + self.interactor.SetPicker(self.measure_picker) + if (state == const.STATE_ZOOM_SL): style = vtk.vtkInteractorStyleRubberBandZoom() self.interactor.SetInteractorStyle(style) @@ -319,9 +324,6 @@ class Viewer(wx.Panel): self.interactor.SetInteractorStyle(style) self.style = style - if state == const.STATE_LINEAR_MEASURE: - self.interactor.SetPicker(self.measure_picker) - # Check each event available for each mode for event in action[state]: # Bind event -- libgit2 0.21.2