MCPcopy Create free account
hub / github.com/cutechess/cutechess / drawRadialGrid

Method drawRadialGrid

projects/gui/3rdparty/qcustomplot/qcustomplot.cpp:34312–34335  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34310}
34311
34312void QCPPolarGrid::drawRadialGrid(QCPPainter *painter, const QPointF &center, const QVector<double> &coords, const QPen &pen, const QPen &zeroPen)
34313{
34314 if (!mRadialAxis) return;
34315 if (coords.isEmpty()) return;
34316 const bool drawZeroLine = zeroPen != Qt::NoPen;
34317 const double zeroLineEpsilon = qAbs(coords.last()-coords.first())*1e-6;
34318
34319 painter->setPen(pen);
34320 for (int i=0; i<coords.size(); ++i)
34321 {
34322 const double r = mRadialAxis->coordToRadius(coords.at(i));
34323 if (drawZeroLine && qAbs(coords.at(i)) < zeroLineEpsilon)
34324 {
34325 applyAntialiasingHint(painter, mAntialiasedZeroLine, QCP::aeZeroLine);
34326 painter->setPen(zeroPen);
34327 painter->drawEllipse(center, r, r);
34328 painter->setPen(pen);
34329 applyDefaultAntialiasingHint(painter);
34330 } else
34331 {
34332 painter->drawEllipse(center, r, r);
34333 }
34334 }
34335}
34336
34337void QCPPolarGrid::drawAngularGrid(QCPPainter *painter, const QPointF &center, double radius, const QVector<QPointF> &ticksCosSin, const QPen &pen)
34338{

Callers

nothing calls this directly

Calls 5

setPenMethod · 0.80
coordToRadiusMethod · 0.80
atMethod · 0.80
isEmptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected