53 p.setRenderHint(QPainter::Antialiasing,
true);
54 p.fillRect(rect(), QColor(9, 13, 19));
56 QFont titleFont = font();
57 titleFont.setBold(
true);
59 p.setPen(QColor(230, 238, 246));
60 p.drawText(QRect(12, 6, width() - 24, 25), Qt::AlignLeft | Qt::AlignVCenter,
61 QStringLiteral(
"Massless Dirac / graphene-like analogue — same E, same barrier"));
65 p.setPen(QColor(145, 162, 178));
66 p.drawText(QRect(20, 45, width() - 40, height() - 65),
67 Qt::AlignCenter | Qt::TextWordWrap,
68 QStringLiteral(
"Load the Massless Dirac / Graphene-like Klein Analogue preset."));
72 const int left = 64, right = 24, top = 50, bottom = 62;
73 QRect plot(left, top, std::max(120, width() - left - right),
74 std::max(120, height() - top - bottom));
75 p.setBrush(QColor(5, 9, 15));
76 p.setPen(QColor(54, 72, 88));
81 const auto xOf = [&](
double angle) {
82 return plot.left() + (angle - amin) / std::max(1.0e-12, amax - amin) * plot.width();
84 const auto yOf = [&](
double transmission) {
85 return plot.bottom() - std::max(0.0, std::min(1.0, transmission)) * plot.height();
90 const double nearNormalEnd = std::min(12.0, amax);
91 if (nearNormalEnd > amin) {
92 p.fillRect(QRectF(xOf(amin), plot.top(), xOf(nearNormalEnd) - xOf(amin), plot.height()),
93 QColor(45, 80, 110, 42));
97 p.setPen(QColor(77, 94, 109));
98 for (
int i = 0; i <= 5; ++i) {
99 const double t =
static_cast<double>(i) / 5.0;
100 const int y =
static_cast<int>(std::lround(yOf(t)));
101 p.drawLine(plot.left(), y, plot.right(), y);
102 p.setPen(QColor(170, 184, 197));
103 p.drawText(QRect(7, y - 9, 50, 18), Qt::AlignRight | Qt::AlignVCenter,
104 QString::number(t,
'f', 1));
105 p.setPen(QColor(77, 94, 109));
107 for (
int i = 0; i <= 7; ++i) {
108 const double angle = amin + (amax - amin) *
static_cast<double>(i) / 7.0;
109 const int x =
static_cast<int>(std::lround(xOf(angle)));
110 p.drawLine(x, plot.top(), x, plot.bottom());
111 p.setPen(QColor(170, 184, 197));
112 p.drawText(QRect(x - 28, plot.bottom() + 5, 56, 20), Qt::AlignHCenter | Qt::AlignTop,
113 QString::number(angle,
'f', 0));
114 p.setPen(QColor(77, 94, 109));
117 auto drawCurve = [&](
bool massless,
const QColor &color,
double width) {
121 if (!point.
valid) { first =
true;
continue; }
124 if (first) { path.moveTo(q); first =
false; }
127 p.setBrush(Qt::NoBrush);
128 p.setPen(QPen(color, width));
132 drawCurve(
false, QColor(220, 130, 255), 2.0);
133 drawCurve(
true, QColor(100, 220, 255), 2.6);
136 double referenceT =
scan_.
points.front().masslessTransmission;
137 for (std::size_t i = 1; i <
scan_.
points.size(); ++i) {
140 if (!a0.valid || !a1.valid)
continue;
143 std::max(1.0e-12, a1.angleDegrees - a0.angleDegrees);
144 referenceT = a0.masslessTransmission + f *
145 (a1.masslessTransmission - a0.masslessTransmission);
150 p.setPen(QPen(QColor(255, 205, 95), 1.5, Qt::DashLine));
151 p.drawLine(x, plot.top(), x, plot.bottom());
152 p.setBrush(QColor(255, 205, 95));
156 p.setBrush(QColor(255, 126, 126));
161 p.setPen(QColor(188, 202, 214));
163 p.drawText(QRect(plot.left(), plot.bottom() + 30, plot.width(), 24), Qt::AlignCenter,
164 QStringLiteral(
"incidence angle (deg) cyan: m=0 violet: massive fixed-E control yellow: current m=0 reference red: packet max P_right"));
167 p.setPen(QColor(235, 240, 245));
168 p.drawText(QRect(plot.left() + 8, plot.top() + 6, plot.width() - 16, 44),
169 Qt::AlignLeft | Qt::AlignTop,
170 QStringLiteral(
"E=%1 V0=%2 width=%3 p(m=0)=%4 p(m=%5)=%6 T0: %7 vs %8")
180 p.setPen(QColor(170, 184, 197));
181 p.drawText(QRect(
static_cast<int>(xOf(amin)) + 4, plot.top() + 30,
182 std::max(0,
static_cast<int>(xOf(nearNormalEnd) - xOf(amin)) - 8), 20),
183 Qt::AlignCenter, QStringLiteral(
"near-normal chirality window"));