Commit 7c998231f939f0552a99ff41c98d1ac3605ce57d
1 parent
9cbf791e
Exists in
interactor_style
Added get_coordinate_cursor to CrossInteractorStyle
Showing
1 changed file
with
12 additions
and
0 deletions
Show diff stats
invesalius/data/styles.py
... | ... | @@ -181,6 +181,18 @@ class CrossInteractorStyle(DefaultInteractorStyle): |
181 | 181 | Publisher.sendMessage(('Set scroll position', 'SAGITAL'), |
182 | 182 | coord[0]) |
183 | 183 | |
184 | + def get_coordinate_cursor(self): | |
185 | + # Find position | |
186 | + x, y, z = self.picker.GetPickPosition() | |
187 | + bounds = self.viewer.slice_data.actor.GetBounds() | |
188 | + if bounds[0] == bounds[1]: | |
189 | + x = bounds[0] | |
190 | + elif bounds[2] == bounds[3]: | |
191 | + y = bounds[2] | |
192 | + elif bounds[4] == bounds[5]: | |
193 | + z = bounds[4] | |
194 | + return x, y, z | |
195 | + | |
184 | 196 | |
185 | 197 | class WWWLInteractorStyle(DefaultInteractorStyle): |
186 | 198 | """ | ... | ... |