MCPcopy Create free account
hub / github.com/LUX-Core/lux / selectTestRect

Method selectTestRect

src/qt/qcustomplot.cpp:23827–23845  ·  view source on GitHub ↗

! \copydoc QCPPlottableInterface1D::selectTestRect */

Source from the content-addressed store, hash-verified

23825 \copydoc QCPPlottableInterface1D::selectTestRect
23826*/
23827QCPDataSelection QCPBars::selectTestRect(const QRectF &rect, bool onlySelectable) const
23828{
23829 QCPDataSelection result;
23830 if ((onlySelectable && mSelectable == QCP::stNone) || mDataContainer->isEmpty())
23831 return result;
23832 if (!mKeyAxis || !mValueAxis)
23833 return result;
23834
23835 QCPBarsDataContainer::const_iterator visibleBegin, visibleEnd;
23836 getVisibleDataBounds(visibleBegin, visibleEnd);
23837
23838 for (QCPBarsDataContainer::const_iterator it=visibleBegin; it!=visibleEnd; ++it)
23839 {
23840 if (rect.intersects(getBarRect(it->key, it->value)))
23841 result.addDataRange(QCPDataRange(it-mDataContainer->constBegin(), it-mDataContainer->constBegin()+1), false);
23842 }
23843 result.simplify();
23844 return result;
23845}
23846
23847/* inherits documentation from base class */
23848double QCPBars::selectTest(const QPointF &pos, bool onlySelectable, QVariant *details) const

Callers 1

processRectSelectionMethod · 0.45

Calls 8

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

Tested by

no test coverage detected