| 186 | |
| 187 | |
| 188 | void |
| 189 | NodePainter:: |
| 190 | drawFilledConnectionPoints(QPainter * painter, |
| 191 | NodeGeometry const & geom, |
| 192 | NodeState const & state, |
| 193 | NodeDataModel const * model) |
| 194 | { |
| 195 | NodeStyle const& nodeStyle = model->nodeStyle(); |
| 196 | auto const & connectionStyle = StyleCollection::connectionStyle(); |
| 197 | |
| 198 | auto diameter = nodeStyle.ConnectionPointDiameter; |
| 199 | |
| 200 | for(PortType portType: {PortType::Out, PortType::In}) |
| 201 | { |
| 202 | size_t n = state.getEntries(portType).size(); |
| 203 | |
| 204 | for (size_t i = 0; i < n; ++i) |
| 205 | { |
| 206 | QPointF p = geom.portScenePosition(i, portType); |
| 207 | |
| 208 | if (!state.getEntries(portType)[i].empty()) |
| 209 | { |
| 210 | auto const & dataType = model->dataType(portType, i); |
| 211 | |
| 212 | if (connectionStyle.useDataDefinedColors()) |
| 213 | { |
| 214 | QColor const c = connectionStyle.normalColor(dataType.id); |
| 215 | painter->setPen(c); |
| 216 | painter->setBrush(c); |
| 217 | } |
| 218 | else |
| 219 | { |
| 220 | painter->setPen(nodeStyle.FilledConnectionPointColor); |
| 221 | painter->setBrush(nodeStyle.FilledConnectionPointColor); |
| 222 | } |
| 223 | |
| 224 | painter->drawEllipse(p, |
| 225 | diameter * 0.4, |
| 226 | diameter * 0.4); |
| 227 | } |
| 228 | } |
| 229 | } |
| 230 | } |
| 231 | |
| 232 | |
| 233 | void |