position_3d.py 1.2 KB

12345678910111213141516171819202122232425
  1. from gui.fig_components.fig_component import FigComponent
  2. from modules.graphs.circular_target import CircularTarget
  3. from modules.graphs.linear_target import LinearTarget
  4. from modules.graphs.style_settings import DEFAULT_STYLE_SETTINGS
  5. class Position3D(FigComponent):
  6. def __init__(self, parent, max_dist=80, step=10, threshold=40, color_settings=DEFAULT_STYLE_SETTINGS):
  7. super().__init__(parent)
  8. self._gs = self._fig.add_gridspec(1, 2, width_ratios=[12, 1], wspace=0.3)
  9. self._target = CircularTarget(self._fig, self._gs[0],
  10. max_dist=max_dist,
  11. step=step,
  12. threshold=threshold,
  13. color_settings=color_settings)
  14. self._depth = LinearTarget(self._fig, self._gs[1],
  15. max_dist=max_dist,
  16. step=step,
  17. threshold=threshold,
  18. color_settings=color_settings)
  19. def plot(self, x, y, z, resize_by_data=False):
  20. self._target.plot(x, y, resize_by_data)
  21. self._depth.plot(z, resize_by_data)