| 30 | } |
| 31 | |
| 32 | void |
| 33 | Circle::paint(QPainter& painter) { |
| 34 | painter.setBrush(brush_); |
| 35 | painter.setPen(pen_); |
| 36 | std::vector<QPoint> plist = dynamics_->getPositionList(); |
| 37 | std::vector<QPoint>::iterator idx = plist.begin(); |
| 38 | |
| 39 | QBrush black( QColor(0x33, 0x33, 0x33), Qt::SolidPattern); |
| 40 | QBrush white( QColor(0xFF, 0xFF, 0xFF), Qt::SolidPattern); |
| 41 | QBrush brush; |
| 42 | while (idx != plist.end()) { |
| 43 | painter.drawEllipse(idx->x() - bounds_.width()/2, |
| 44 | idx->y() - bounds_.height()/2, |
| 45 | bounds_.width(), |
| 46 | bounds_.height()); |
| 47 | if (targeted_) |
| 48 | brush = black; |
| 49 | else |
| 50 | brush = white; |
| 51 | |
| 52 | int X0 = idx->x(); |
| 53 | int Y0 = idx->y(); |
| 54 | int W = bounds_.width()/3; |
| 55 | int H = bounds_.height()/3; |
| 56 | painter.setBrush(brush); |
| 57 | painter.drawEllipse(X0 - W/2, |
| 58 | Y0 - H/2, |
| 59 | W, |
| 60 | H); |
| 61 | painter.setBrush(brush_); |
| 62 | |
| 63 | ++idx; |
| 64 | } |
| 65 | } |
| 66 | |
| 67 | Circle::~Circle() { |
| 68 | } |
no test coverage detected