MCPcopy Create free account
hub / github.com/collin80/SavvyCAN / selectTestRect

Method selectTestRect

qcustomplot.cpp:23889–23907  ·  view source on GitHub ↗

! \copydoc QCPPlottableInterface1D::selectTestRect */

Source from the content-addressed store, hash-verified

23887 \copydoc QCPPlottableInterface1D::selectTestRect
23888*/
23889QCPDataSelection QCPBars::selectTestRect(const QRectF &rect, bool onlySelectable) const
23890{
23891 QCPDataSelection result;
23892 if ((onlySelectable && mSelectable == QCP::stNone) || mDataContainer->isEmpty())
23893 return result;
23894 if (!mKeyAxis || !mValueAxis)
23895 return result;
23896
23897 QCPBarsDataContainer::const_iterator visibleBegin, visibleEnd;
23898 getVisibleDataBounds(visibleBegin, visibleEnd);
23899
23900 for (QCPBarsDataContainer::const_iterator it=visibleBegin; it!=visibleEnd; ++it)
23901 {
23902 if (rect.intersects(getBarRect(it->key, it->value)))
23903 result.addDataRange(QCPDataRange(it-mDataContainer->constBegin(), it-mDataContainer->constBegin()+1), false);
23904 }
23905 result.simplify();
23906 return result;
23907}
23908
23909/*!
23910 Implements a selectTest specific to this plottable's point geometry.

Callers 1

processRectSelectionMethod · 0.45

Calls 8

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

Tested by

no test coverage detected