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

Method plotEdge

limsim/simModel/common/networkBuild.py:380–403  ·  view source on GitHub ↗

edge: 某个方向几条车道的集合

(self, eid: str, widget: QWidget, ex: float, ey: float,
                 ctf: CoordTF, is_selectable: bool = False)

Source from the content-addressed store, hash-verified

378
379
380 def plotEdge(self, eid: str, widget: QWidget, ex: float, ey: float,
381 ctf: CoordTF, is_selectable: bool = False):
382 '''
383 edge: 某个方向几条车道的集合
384 '''
385 edge = self.getEdge(eid)
386 lane_index = 0
387 lanes = list(edge.lanes)
388 lanes.sort()
389 for lane_id in lanes:
390 lane = self.getLane(lane_id)
391 flag = lane_index == 0
392 self.plotLane(lane, flag, ex, ey, widget, ctf, is_selectable)
393 lane_index += 1
394
395 # 根据左右边界获取 edge 的封闭图形
396 # left_bound_tf.reverse()
397 # x = right_bound_tf[15][0]
398 # y = right_bound_tf[15][1]
399 # right_bound_tf.extend(left_bound_tf)
400 # right_bound_tf.append(right_bound_tf[0])
401 # widget.drawPolygon(right_bound_tf, pen_color=QColor(0, 0, 0), pen_width=2, brush_color=QColor(0,0,0,30), is_selectable=True, data=eid)
402
403 # widget.addText(x, y, eid)
404
405 def plotJunctionLane(self, jlid: str, widget: QWidget, ex: float, ey: float,
406 ctf: CoordTF):

Callers 5

plotSceneMethod · 0.95
plotSceneMethod · 0.80
plotSceneMethod · 0.80
plotSceneMethod · 0.80
plotSceneMethod · 0.80

Calls 3

getEdgeMethod · 0.95
getLaneMethod · 0.95
plotLaneMethod · 0.95

Tested by

no test coverage detected