def add_waiting_list_poly(self, poly_verts, mode_name):
'''add a polygon on the waiting list'''
polys = self.waiting_list_mode_to_polys.get(mode_name)
if polys is None:
face_col, edge_col = self.mode_colors.get_edge_face_colors(mode_name)
polys = collections.PolyCollection([], lw=2, animated=True, alpha=0.3,
edgecolor=edge_col, facecolor=face_col)
self.axes.add_collection(polys)
self.waiting_list_mode_to_polys[mode_name] = polys
paths = polys.get_paths()
codes = [Path.MOVETO] + [Path.LINETO] * (len(poly_verts) - 2) + [Path.CLOSEPOLY]
paths.append(Path(poly_verts, codes))
评论列表
文章目录