54 static const int GridLineDistanceTreshold = 20;
57 PainterSaver s(&painter);
59 Q_ASSERT_X(plane,
"TernaryGrid::drawGrid",
60 "Bad function call: PaintContext::coodinatePlane() NOT a ternary plane.");
63 const int MaxDepth = 3;
66 if (xPixels > 10 * GridLineDistanceTreshold)
68 if (xPixels > 20 * GridLineDistanceTreshold)
72 for (
int i = granularity; i < 100; i += granularity) {
78 m_tickInfo.append(tick);
83 for (
const TickInfo &tick : qAsConst(m_tickInfo)) {
84 const qreal &percent = tick.percentage;
91 plane->translate(end)));
99 plane->translate(end)));
106 lines[tick.depth].
append(
QLineF(plane->translate(start),
107 plane->translate(end)));
149 percentages.
erase(std::unique(percentages.
begin(), percentages.
end()),
153 for (
const TickInfo &tick : percentages) {
154 const qreal &percent = tick.percentage;
160 plane->translate(start - markerDistance)));
166 const QPointF end(start + markerDistance);
168 plane->translate(end)));
175 const QPointF end(start + markerDistance);
177 plane->translate(end)));
Stores information about painting diagrams.
AbstractCoordinatePlane * coordinatePlane() const
QPainter * painter() const