MCPcopy Index your code
hub / github.com/Audio4Linux/JDSP4Linux / drawFill

Method drawFill

3rdparty/qcustomplot/qcustomplot.cpp:21605–21630  ·  view source on GitHub ↗

! \internal Draws the fill of the graph using the specified \a painter, with the currently set brush. Depending on whether a normal fill or a channel fill (\ref setChannelFillGraph) is needed, \ref getFillPolygon or \ref getChannelFillPolygon are used to find the according fill polygons. In order to handle NaN Data points correctly (the fill needs to be split into disjoint areas),

Source from the content-addressed store, hash-verified

21603 \see drawLinePlot, drawImpulsePlot, drawScatterPlot
21604*/
21605void QCPGraph::drawFill(QCPPainter *painter, QVector<QPointF> *lines) const
21606{
21607 if (mLineStyle == lsImpulse) return; // fill doesn't make sense for impulse plot
21608 if (painter->brush().style() == Qt::NoBrush || painter->brush().color().alpha() == 0) return;
21609
21610 applyFillAntialiasingHint(painter);
21611 const QVector<QCPDataRange> segments = getNonNanSegments(lines, keyAxis()->orientation());
21612 if (!mChannelFillGraph)
21613 {
21614 // draw base fill under graph, fill goes all the way to the zero-value-line:
21615 foreach (QCPDataRange segment, segments)
21616 painter->drawPolygon(getFillPolygon(lines, segment));
21617 } else
21618 {
21619 // draw fill between this graph and mChannelFillGraph:
21620 QVector<QPointF> otherLines;
21621 mChannelFillGraph->getLines(&otherLines, QCPDataRange(0, mChannelFillGraph->dataCount()));
21622 if (!otherLines.isEmpty())
21623 {
21624 QVector<QCPDataRange> otherSegments = getNonNanSegments(&otherLines, mChannelFillGraph->keyAxis()->orientation());
21625 QVector<QPair<QCPDataRange, QCPDataRange> > segmentPairs = getOverlappingSegments(segments, lines, otherSegments, &otherLines);
21626 for (int i=0; i<segmentPairs.size(); ++i)
21627 painter->drawPolygon(getChannelFillPolygon(lines, segmentPairs.at(i).first, &otherLines, segmentPairs.at(i).second));
21628 }
21629 }
21630}
21631
21632/*! \internal
21633

Callers

nothing calls this directly

Calls 8

keyAxisFunction · 0.85
alphaMethod · 0.80
getLinesMethod · 0.80
colorMethod · 0.45
dataCountMethod · 0.45
isEmptyMethod · 0.45
sizeMethod · 0.45
atMethod · 0.45

Tested by

no test coverage detected