MCPcopy Create free account
hub / github.com/PJLab-ADG/OASim / showTextOnEdge

Method showTextOnEdge

limsim/simModel/common/networkBuild.py:466–492  ·  view source on GitHub ↗
(self, signal: Signal, eid: str, text: str, ex:float, ey:float, ctf: CoordTF)

Source from the content-addressed store, hash-verified

464 self.plotJunction(jc, widget, ex, ey, ctf)
465
466 def showTextOnEdge(self, signal: Signal, eid: str, text: str, ex:float, ey:float, ctf: CoordTF):
467 edge = self.getEdge(eid)
468 lane_index = 0
469 lanes = list(edge.lanes)
470 lanes.sort()
471 lane_num = len(lanes)
472 for lane_id in lanes:
473 lane = self.getLane(lane_id)
474 flag = 0b00
475 if lane_index == 0:
476 flag += 1
477 if lane_index == lane_num - 1:
478 flag += 2
479 if flag & 0b10:
480 left_bound_tf = [
481 ctf.qtCoord(wp[0], wp[1], ex, ey) for wp in lane.left_bound
482 ]
483 if flag & 0b01:
484 right_bound_tf = [
485 ctf.qtCoord(wp[0], wp[1], ex, ey) for wp in lane.right_bound
486 ]
487 lane_index += 1
488
489 index = 25
490 x = min(left_bound_tf[index][0], right_bound_tf[index][0])
491 y = min(left_bound_tf[index][1], right_bound_tf[index][1])
492 # widget.addText(x, y, text, fontsize=15)
493
494
495class Rebuild(NetworkBuild):

Callers

nothing calls this directly

Calls 3

getEdgeMethod · 0.95
getLaneMethod · 0.95
qtCoordMethod · 0.80

Tested by

no test coverage detected