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

Method plotJunctionLane

limsim/simModel/common/networkBuild.py:405–444  ·  view source on GitHub ↗
(self, jlid: str, widget: QWidget, ex: float, ey: float,
                         ctf: CoordTF)

Source from the content-addressed store, hash-verified

403 # widget.addText(x, y, eid)
404
405 def plotJunctionLane(self, jlid: str, widget: QWidget, ex: float, ey: float,
406 ctf: CoordTF):
407 juncLane = self.getJunctionLane(jlid)
408 if juncLane:
409 try:
410 center_line = juncLane.center_line
411 except AttributeError:
412 return
413 # center_line_tf = [
414 # ctf.qtCoord(wp[0], wp[1], ex, ey) for wp in center_line
415 # ]
416 if juncLane.currTlState:
417 if juncLane.currTlState == 'r':
418 # jlColor = (232, 65, 24)
419 jlColor = QColor(255, 107, 129, 100)
420 elif juncLane.currTlState == 'y':
421 jlColor = QColor(251, 197, 49, 100)
422 elif juncLane.currTlState == 'g' or juncLane.currTlState == 'G':
423 jlColor = QColor(39, 174, 96, 100)
424 else:
425 jlColor = QColor(255, 255, 255, 50)
426 right_bound_tf = [
427 ctf.qtCoord(wp[0], wp[1], ex, ey) for wp in juncLane.right_bound
428 ]
429 left_bound_tf = [
430 ctf.qtCoord(wp[0], wp[1], ex, ey) for wp in juncLane.left_bound
431 ]
432 left_bound_tf.reverse()
433 right_bound_tf.extend(left_bound_tf)
434 right_bound_tf.append(right_bound_tf[0])
435 widget.drawPolygon(right_bound_tf, jlColor, jlColor, 1)
436 # graphics_items.append(graphicsItem('polygon', right_bound_tf, jlColor, jlColor, 1))
437 # signal.emit('polygon', right_bound_tf, jlColor, jlColor, 1, True, jlid)
438 # signal.emit('polyline', center_line_tf, jlColor, jlColor, 12, False, "")
439 # if flag:
440 # right_bound_tf = [
441 # ctf.qtCoord(wp[0], wp[1], ex, ey) for wp in juncLane.right_bound
442 # ]
443 # signal.emit('polyline', right_bound_tf, QColor(100, 149, 237), QColor(0, 0, 0), 2, False, "")
444 # widget.drawPolyline(center_line_tf, color=jlColor,width=15)
445
446
447 def plotJunction(

Callers 1

plotJunctionMethod · 0.95

Calls 3

getJunctionLaneMethod · 0.95
qtCoordMethod · 0.80
drawPolygonMethod · 0.80

Tested by

no test coverage detected