Commit acdab97e958b3a0feb7b18b49bd30b35e20ae4f1
1 parent
9cd994d3
Exists in
master
Updating cross when scrolling on 3D too
Showing
2 changed files
with
4 additions
and
1 deletions
Show diff stats
invesalius/data/viewer_slice.py
... | ... | @@ -570,7 +570,6 @@ class Viewer(wx.Panel): |
570 | 570 | ux, uy, uz = position[:3] |
571 | 571 | px, py = self.get_slice_pixel_coord_by_world_pos(ux, uy, uz) |
572 | 572 | coord = self.calcultate_scroll_position(px, py) |
573 | - print(position, coord) | |
574 | 573 | |
575 | 574 | self.cross.SetFocalPoint((ux, uy, uz)) |
576 | 575 | self.ScrollSlice(coord) | ... | ... |
invesalius/data/viewer_volume.py
... | ... | @@ -283,6 +283,7 @@ class Viewer(wx.Panel): |
283 | 283 | |
284 | 284 | Publisher.subscribe(self.UpdateCameraBallPosition, |
285 | 285 | 'Update cross position') |
286 | + Publisher.subscribe(self.SetCrossFocalPoint, 'Set cross focal point') | |
286 | 287 | Publisher.subscribe(self._check_ball_reference, 'Enable style') |
287 | 288 | Publisher.subscribe(self._uncheck_ball_reference, 'Disable style') |
288 | 289 | |
... | ... | @@ -1200,6 +1201,9 @@ class Viewer(wx.Panel): |
1200 | 1201 | |
1201 | 1202 | self.ren.AddActor(self.ball_actor) |
1202 | 1203 | |
1204 | + def SetCrossFocalPoint(self, position): | |
1205 | + self.UpdateCameraBallPosition(None, position) | |
1206 | + | |
1203 | 1207 | def UpdateCameraBallPosition(self, arg, position): |
1204 | 1208 | coord_flip = bases.flip_x_m(position[:3])[:3, 0] |
1205 | 1209 | self.ball_actor.SetPosition(coord_flip) | ... | ... |