MCPcopy Create free account
hub / github.com/CloudCompare/CloudCompare / selectTestRect

Method selectTestRect

qCC/extern/QCustomPlot/qcustomplot.cpp:24647–24665  ·  view source on GitHub ↗

! \copydoc QCPPlottableInterface1D::selectTestRect */

Source from the content-addressed store, hash-verified

24645 \copydoc QCPPlottableInterface1D::selectTestRect
24646*/
24647QCPDataSelection QCPBars::selectTestRect(const QRectF &rect, bool onlySelectable) const
24648{
24649 QCPDataSelection result;
24650 if ((onlySelectable && mSelectable == QCP::stNone) || mDataContainer->isEmpty())
24651 return result;
24652 if (!mKeyAxis || !mValueAxis)
24653 return result;
24654
24655 QCPBarsDataContainer::const_iterator visibleBegin, visibleEnd;
24656 getVisibleDataBounds(visibleBegin, visibleEnd);
24657
24658 for (QCPBarsDataContainer::const_iterator it=visibleBegin; it!=visibleEnd; ++it)
24659 {
24660 if (rect.intersects(getBarRect(it->key, it->value)))
24661 result.addDataRange(QCPDataRange(int(it-mDataContainer->constBegin()), int(it-mDataContainer->constBegin()+1)), false);
24662 }
24663 result.simplify();
24664 return result;
24665}
24666
24667/*!
24668 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