From 7c998231f939f0552a99ff41c98d1ac3605ce57d Mon Sep 17 00:00:00 2001 From: Thiago Franco de Moraes Date: Wed, 27 Mar 2013 15:00:48 -0300 Subject: [PATCH] Added get_coordinate_cursor to CrossInteractorStyle --- invesalius/data/styles.py | 12 ++++++++++++ 1 file changed, 12 insertions(+), 0 deletions(-) diff --git a/invesalius/data/styles.py b/invesalius/data/styles.py index 06e4bc6..54df8c6 100644 --- a/invesalius/data/styles.py +++ b/invesalius/data/styles.py @@ -181,6 +181,18 @@ class CrossInteractorStyle(DefaultInteractorStyle): Publisher.sendMessage(('Set scroll position', 'SAGITAL'), coord[0]) + def get_coordinate_cursor(self): + # Find position + x, y, z = self.picker.GetPickPosition() + bounds = self.viewer.slice_data.actor.GetBounds() + if bounds[0] == bounds[1]: + x = bounds[0] + elif bounds[2] == bounds[3]: + y = bounds[2] + elif bounds[4] == bounds[5]: + z = bounds[4] + return x, y, z + class WWWLInteractorStyle(DefaultInteractorStyle): """ -- libgit2 0.21.2