| 20 | self.data = data |
| 21 | |
| 22 | class CoordTF: |
| 23 | # Ego is always in the center of the window |
| 24 | def __init__(self, realSize: float, height:float) -> None: |
| 25 | self.realSize: float = realSize |
| 26 | self.drawCenter: float = self.realSize / 2 |
| 27 | self.qtDrawSize: float = height |
| 28 | self.offset = (0, 0) |
| 29 | |
| 30 | @property |
| 31 | def zoomScale(self) -> float: |
| 32 | return self.qtDrawSize / self.realSize |
| 33 | |
| 34 | def qtCoord( |
| 35 | self, x: float, y: float, ex: float, ey: float) -> tuple[QPointF]: |
| 36 | relx, rely = x - ex, y - ey |
| 37 | return QPointF( |
| 38 | self.zoomScale * (self.drawCenter + relx + self.offset[0]), |
| 39 | self.zoomScale * (self.drawCenter - rely + self.offset[1]) |
| 40 | ) |
| 41 | |
| 42 | |
| 43 | def deduceEdge(laneID: str) -> str: |