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

Method selectTestRect

3rdparty/qcustomplot/qcustomplot.cpp:24682–24700  ·  view source on GitHub ↗

! \copydoc QCPPlottableInterface1D::selectTestRect */

Source from the content-addressed store, hash-verified

24680 \copydoc QCPPlottableInterface1D::selectTestRect
24681*/
24682QCPDataSelection QCPBars::selectTestRect(const QRectF &rect, bool onlySelectable) const
24683{
24684 QCPDataSelection result;
24685 if ((onlySelectable && mSelectable == QCP::stNone) || mDataContainer->isEmpty())
24686 return result;
24687 if (!mKeyAxis || !mValueAxis)
24688 return result;
24689
24690 QCPBarsDataContainer::const_iterator visibleBegin, visibleEnd;
24691 getVisibleDataBounds(visibleBegin, visibleEnd);
24692
24693 for (QCPBarsDataContainer::const_iterator it=visibleBegin; it!=visibleEnd; ++it)
24694 {
24695 if (rect.intersects(getBarRect(it->key, it->value)))
24696 result.addDataRange(QCPDataRange(int(it-mDataContainer->constBegin()), int(it-mDataContainer->constBegin()+1)), false);
24697 }
24698 result.simplify();
24699 return result;
24700}
24701
24702/*!
24703 Implements a selectTest specific to this plottable's point geometry.

Callers 1

processRectSelectionMethod · 0.45

Calls 6

intersectsMethod · 0.80
addDataRangeMethod · 0.80
constBeginMethod · 0.80
simplifyMethod · 0.80
isEmptyMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected