MCPcopy Create free account
hub / github.com/OpenDDS/OpenDDS / paint

Method paint

examples/DCPS/ishapes/Circle.cpp:32–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30}
31
32void
33Circle::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
67Circle::~Circle() {
68}

Callers 1

paintEventMethod · 0.45

Calls 6

setBrushMethod · 0.80
setPenMethod · 0.80
getPositionListMethod · 0.80
widthMethod · 0.80
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected