52 p.setRenderHint(QPainter::Antialiasing,
true);
53 p.fillRect(rect(), QColor(9, 13, 19));
55 QFont titleFont = font();
56 titleFont.setBold(
true);
58 p.setPen(QColor(230, 238, 246));
59 p.drawText(QRect(12, 6, width() - 24, 25), Qt::AlignLeft | Qt::AlignVCenter,
60 QStringLiteral(
"Klein barrier-height reference — stationary plane-wave T(V0)"));
64 p.setPen(QColor(145, 162, 178));
65 p.drawText(QRect(20, 45, width() - 40, height() - 65),
66 Qt::AlignCenter | Qt::TextWordWrap,
67 QStringLiteral(
"Load the Klein Transmission vs Barrier Height preset."));
71 const int left = 64, right = 24, top = 48, bottom = 58;
72 QRect plot(left, top, std::max(120, width() - left - right),
73 std::max(120, height() - top - bottom));
74 p.setBrush(QColor(5, 9, 15));
75 p.setPen(QColor(54, 72, 88));
80 const auto xOf = [&](
double v) {
81 return plot.left() + (v - vmin) / std::max(1.0e-12, vmax - vmin) * plot.width();
83 const auto yOf = [&](
double transmission) {
84 return plot.bottom() - std::max(0.0, std::min(1.0, transmission)) * plot.height();
92 p.fillRect(QRectF(xOf(vmin), plot.top(), xOf(low) - xOf(vmin), plot.height()), QColor(40, 85, 60, 45));
94 p.fillRect(QRectF(xOf(low), plot.top(), xOf(high) - xOf(low), plot.height()), QColor(120, 85, 35, 55));
96 p.fillRect(QRectF(xOf(high), plot.top(), xOf(vmax) - xOf(high), plot.height()), QColor(45, 70, 120, 45));
99 p.setPen(QColor(77, 94, 109));
100 for (
int i = 0; i <= 5; ++i) {
101 const double t =
static_cast<double>(i) / 5.0;
102 const int y =
static_cast<int>(std::lround(yOf(t)));
103 p.drawLine(plot.left(), y, plot.right(), y);
104 p.setPen(QColor(170, 184, 197));
105 p.drawText(QRect(7, y - 9, 50, 18), Qt::AlignRight | Qt::AlignVCenter,
106 QString::number(t,
'f', 1));
107 p.setPen(QColor(77, 94, 109));
110 for (
int i = 0; i <= 8; ++i) {
111 const double v = vmin + (vmax - vmin) *
static_cast<double>(i) / 8.0;
112 const int x =
static_cast<int>(std::lround(xOf(v)));
113 p.drawLine(x, plot.top(), x, plot.bottom());
114 p.setPen(QColor(170, 184, 197));
115 p.drawText(QRect(x - 24, plot.bottom() + 5, 48, 20), Qt::AlignHCenter | Qt::AlignTop,
116 QString::number(v,
'f', 1));
117 p.setPen(QColor(77, 94, 109));
122 p.setPen(QPen(QColor(255, 205, 95), 1.4, Qt::DashLine));
123 p.drawLine(x, plot.top(), x, plot.bottom());
127 p.setPen(QPen(QColor(255, 205, 95), 1.4, Qt::DashLine));
128 p.drawLine(x, plot.top(), x, plot.bottom());
134 if (!point.
valid) { first =
true;
continue; }
136 if (first) { path.moveTo(q); first =
false; }
139 p.setPen(QPen(QColor(100, 220, 255), 2.4));
140 p.setBrush(Qt::NoBrush);
144 double referenceT =
scan_.
points.front().transmission;
145 for (std::size_t i = 1; i <
scan_.
points.size(); ++i) {
148 if (!a0.valid || !a1.valid)
continue;
151 std::max(1.0e-12, a1.barrierHeight - a0.barrierHeight);
152 referenceT = a0.transmission + f * (a1.transmission - a0.transmission);
157 p.setPen(QPen(QColor(255, 205, 95), 1.5, Qt::DashLine));
158 p.drawLine(x, plot.top(), x, plot.bottom());
159 p.setBrush(QColor(255, 205, 95));
164 p.setBrush(QColor(255, 126, 126));
169 p.setPen(QColor(188, 202, 214));
171 p.drawText(QRect(plot.left(), plot.bottom() + 29, plot.width(), 22), Qt::AlignCenter,
172 QStringLiteral(
"barrier height V0 | cyan: plane-wave T(V0) yellow: current reference red: time-domain packet max P_right"));
174 p.setPen(QColor(235, 240, 245));
175 p.drawText(QRect(plot.left() + 8, plot.top() + 6, plot.width() - 16, 44),
176 Qt::AlignLeft | Qt::AlignTop,
177 QStringLiteral(
"E=%1 |p|=%2 angle=%3 deg width=%4 thresholds: %5 / %6")
185 p.setPen(QColor(170, 184, 197));
186 const int labelY = plot.top() + 28;
187 p.drawText(QRect(
static_cast<int>(xOf(vmin)) + 6, labelY, std::max(0,
static_cast<int>(xOf(low) - xOf(vmin)) - 12), 20),
188 Qt::AlignCenter, QStringLiteral(
"positive branch"));
189 p.drawText(QRect(
static_cast<int>(xOf(low)), labelY, std::max(0,
static_cast<int>(xOf(high) - xOf(low))), 20),
190 Qt::AlignCenter, QStringLiteral(
"evanescent"));
191 p.drawText(QRect(
static_cast<int>(xOf(high)), labelY, std::max(0,
static_cast<int>(xOf(vmax) - xOf(high))), 20),
192 Qt::AlignCenter, QStringLiteral(
"supercritical Klein"));