| 321 | } |
| 322 | |
| 323 | QString SetRepositoryAlgorithms::dumpDotGraphInternal(uint nodeIndex, bool master) const |
| 324 | { |
| 325 | if (!nodeIndex) |
| 326 | return QStringLiteral("empty node"); |
| 327 | |
| 328 | const SetNodeData& node(*repository.itemFromIndex(nodeIndex)); |
| 329 | |
| 330 | QString color = QStringLiteral("blue"); |
| 331 | if (master) |
| 332 | color = QStringLiteral("red"); |
| 333 | |
| 334 | QString label = QStringLiteral("%1 -> %2").arg(node.start()).arg(node.end()); |
| 335 | if (!node.contiguous()) |
| 336 | label += QLatin1String(", with gaps"); |
| 337 | |
| 338 | QString ret = QStringLiteral("%1[label=\"%2\", color=\"%3\"];\n").arg(shortLabel(node), label, color); |
| 339 | |
| 340 | if (node.leftNode()) { |
| 341 | const SetNodeData& left(*repository.itemFromIndex(node.leftNode())); |
| 342 | const SetNodeData& right(*repository.itemFromIndex(node.rightNode())); |
| 343 | Q_ASSERT(node.rightNode()); |
| 344 | ret += QStringLiteral("%1 -> %2;\n").arg(shortLabel(node), shortLabel(left)); |
| 345 | ret += QStringLiteral("%1 -> %2;\n").arg(shortLabel(node), shortLabel(right)); |
| 346 | ret += dumpDotGraphInternal(node.leftNode()); |
| 347 | ret += dumpDotGraphInternal(node.rightNode()); |
| 348 | } |
| 349 | |
| 350 | return ret; |
| 351 | } |
| 352 | |
| 353 | QString SetRepositoryAlgorithms::dumpDotGraph(uint nodeIndex) const |
| 354 | { |
nothing calls this directly
no test coverage detected