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 angular reference — stationary plane-wave T(theta) at fixed |p|"));
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 Incidence Angle preset."));
71 const int left = 62, right = 22, top = 46, bottom = 54;
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 angle) {
81 return plot.left() + (angle - amin) / std::max(1.0e-12, amax - amin) * plot.width();
83 const auto yOf = [&](
double transmission) {
84 return plot.bottom() - std::max(0.0, std::min(1.0, transmission)) * plot.height();
88 p.setPen(QColor(77, 94, 109));
89 for (
int i = 0; i <= 5; ++i) {
90 const double t =
static_cast<double>(i) / 5.0;
91 const int y =
static_cast<int>(std::lround(yOf(t)));
92 p.drawLine(plot.left(), y, plot.right(), y);
93 p.setPen(QColor(170, 184, 197));
94 p.drawText(QRect(6, y - 9, 50, 18), Qt::AlignRight | Qt::AlignVCenter,
95 QString::number(t,
'f', 1));
96 p.setPen(QColor(77, 94, 109));
99 for (
int a = 0; a <= 70; a += 10) {
100 if (a < amin || a > amax)
continue;
101 const int x =
static_cast<int>(std::lround(xOf(
static_cast<double>(a))));
102 p.drawLine(x, plot.top(), x, plot.bottom());
103 p.setPen(QColor(170, 184, 197));
104 p.drawText(QRect(x - 24, plot.bottom() + 5, 48, 20), Qt::AlignHCenter | Qt::AlignTop,
105 QStringLiteral(
"%1 deg").arg(a));
106 p.setPen(QColor(77, 94, 109));
112 if (!point.
valid) { first =
true;
continue; }
114 if (first) { path.moveTo(q); first =
false; }
117 p.setPen(QPen(QColor(100, 220, 255), 2.4));
118 p.setBrush(Qt::NoBrush);
123 double referenceT =
scan_.
points.front().transmission;
124 for (std::size_t i = 1; i <
scan_.
points.size(); ++i) {
129 std::max(1.0e-12, a1.angleDegrees - a0.angleDegrees);
130 referenceT = a0.transmission + f * (a1.transmission - a0.transmission);
135 p.setPen(QPen(QColor(255, 205, 95), 1.5, Qt::DashLine));
136 p.drawLine(x, plot.top(), x, plot.bottom());
137 p.setBrush(QColor(255, 205, 95));
142 p.setBrush(QColor(255, 126, 126));
147 p.setPen(QColor(188, 202, 214));
149 p.drawText(QRect(plot.left(), plot.bottom() + 27, plot.width(), 22), Qt::AlignCenter,
150 QStringLiteral(
"incidence angle theta | cyan: plane-wave reference yellow: current reference red: time-domain packet max P_right"));
152 p.setPen(QColor(235, 240, 245));
153 p.drawText(QRect(plot.left() + 8, plot.top() + 6, plot.width() - 16, 42),
154 Qt::AlignLeft | Qt::AlignTop,
155 QStringLiteral(
"|p|=%1 E=%2 V0=%3 width=%4 scan=%5..%6 deg")