| 121 | dc.SetBrush(brush) |
| 122 | |
| 123 | def draw_circle(pts, dc, f, **key): |
| 124 | pen, brush = dc.GetPen(), dc.GetBrush() |
| 125 | width, color = pen.GetWidth(), pen.GetColour() |
| 126 | fcolor, style = brush.GetColour(), brush.GetStyle() |
| 127 | |
| 128 | if 'color' in pts: |
| 129 | pen.SetColour(pts['color']) |
| 130 | if 'fcolor' in pts: |
| 131 | brush.SetColour(pts['fcolor']) |
| 132 | if 'lw' in pts: |
| 133 | pen.SetWidth(pts['lw']) |
| 134 | if 'fill' in pts: |
| 135 | brush.SetStyle((106,100)[pts['fill']]) |
| 136 | |
| 137 | dc.SetPen(pen) |
| 138 | dc.SetBrush(brush) |
| 139 | |
| 140 | if pts['type'] == 'circle': |
| 141 | x, y ,r = pts['body'] |
| 142 | x, y = f(x, y) |
| 143 | dc.DrawCircle(x, y, r*key['k']) |
| 144 | if pts['type'] == 'circles': |
| 145 | lst = [] |
| 146 | for x, y ,r in pts['body']: |
| 147 | x, y = f(x, y) |
| 148 | r *= key['k'] |
| 149 | lst.append((x-r,y-r,r*2,r*2)) |
| 150 | dc.DrawEllipseList(lst) |
| 151 | |
| 152 | pen.SetWidth(width) |
| 153 | pen.SetColour(color) |
| 154 | brush.SetColour(fcolor) |
| 155 | brush.SetStyle(style) |
| 156 | dc.SetPen(pen) |
| 157 | dc.SetBrush(brush) |
| 158 | |
| 159 | def make_ellipse(l1, l2, ang): |
| 160 | m = np.array([[l1*cos(-ang),-l2*sin(-ang)], |