| 166 | } |
| 167 | |
| 168 | void TOPPASVertex::paint(QPainter* painter, const QStyleOptionGraphicsItem* /*option*/, QWidget* /*widget*/, bool round_shape) |
| 169 | { |
| 170 | QPen pen(pen_color_, 1, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin); |
| 171 | if (isSelected()) |
| 172 | { |
| 173 | pen.setWidth(2); |
| 174 | painter->setBrush(brush_color_.darker(130)); |
| 175 | pen.setColor(Qt::darkBlue); |
| 176 | } |
| 177 | else |
| 178 | { |
| 179 | painter->setBrush(brush_color_); |
| 180 | } |
| 181 | painter->setPen(pen); |
| 182 | |
| 183 | QPainterPath path; |
| 184 | if (round_shape) |
| 185 | { |
| 186 | path.addRoundedRect(boundingRect().marginsRemoved(QMarginsF(1, 1, 1, 1)), 20, 20); |
| 187 | } |
| 188 | else |
| 189 | { |
| 190 | path.addRect(boundingRect().marginsRemoved(QMarginsF(1, 1, 1, 1))); |
| 191 | } |
| 192 | painter->drawPath(path); |
| 193 | |
| 194 | pen.setColor(pen_color_); |
| 195 | painter->setPen(pen); |
| 196 | |
| 197 | // topo sort number |
| 198 | painter->drawText(boundingRect().x() + 7, boundingRect().y() + 20, QString::number(topo_nr_)); |
| 199 | |
| 200 | // recycling status |
| 201 | if (this->allow_output_recycling_) |
| 202 | { |
| 203 | QSvgRenderer* svg_renderer = new QSvgRenderer(QString(":/Recycling_symbol.svg"), nullptr); |
| 204 | svg_renderer->render(painter, QRectF(-7, boundingRect().y() + 9.0, 14, 14)); |
| 205 | } |
| 206 | } |
| 207 | |
| 208 | QPainterPath TOPPASVertex::shape() const |
| 209 | { |