! \copydoc QCPPlottableInterface1D::selectTestRect */
| 24680 | \copydoc QCPPlottableInterface1D::selectTestRect |
| 24681 | */ |
| 24682 | QCPDataSelection 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. |
no test coverage detected