! \internal Returns whether the error bar at the specified \a index is visible within the current key axis range. This method assumes for performance reasons without checking that the key axis, the value axis, and the data plottable (\ref setDataPlottable) are not \c nullptr and that \a index is within valid bounds of this \ref QCPErrorBars instance and the bounds of the data plottable
| 28804 | valid bounds of this \ref QCPErrorBars instance and the bounds of the data plottable. |
| 28805 | */ |
| 28806 | bool QCPErrorBars::errorBarVisible(int index) const |
| 28807 | { |
| 28808 | QPointF centerPixel = mDataPlottable->interface1D()->dataPixelPosition(index); |
| 28809 | const double centerKeyPixel = mKeyAxis->orientation() == Qt::Horizontal ? centerPixel.x() : centerPixel.y(); |
| 28810 | if (qIsNaN(centerKeyPixel)) |
| 28811 | return false; |
| 28812 | |
| 28813 | double keyMin, keyMax; |
| 28814 | if (mErrorType == etKeyError) |
| 28815 | { |
| 28816 | const double centerKey = mKeyAxis->pixelToCoord(centerKeyPixel); |
| 28817 | const double errorPlus = mDataContainer->at(index).errorPlus; |
| 28818 | const double errorMinus = mDataContainer->at(index).errorMinus; |
| 28819 | keyMax = centerKey+(qIsNaN(errorPlus) ? 0 : errorPlus); |
| 28820 | keyMin = centerKey-(qIsNaN(errorMinus) ? 0 : errorMinus); |
| 28821 | } else // mErrorType == etValueError |
| 28822 | { |
| 28823 | keyMax = mKeyAxis->pixelToCoord(centerKeyPixel+mWhiskerWidth*0.5*mKeyAxis->pixelOrientation()); |
| 28824 | keyMin = mKeyAxis->pixelToCoord(centerKeyPixel-mWhiskerWidth*0.5*mKeyAxis->pixelOrientation()); |
| 28825 | } |
| 28826 | return ((keyMax > mKeyAxis->range().lower) && (keyMin < mKeyAxis->range().upper)); |
| 28827 | } |
| 28828 | |
| 28829 | /*! \internal |
| 28830 |
nothing calls this directly
no test coverage detected