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

Method errorBarVisible

src/qt/qcustomplot.cpp:27926–27947  ·  view source on GitHub ↗

! \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 zero and that \a index is within valid bounds of this \ref QCPErrorBars instance and the bounds of the data plottable. */

Source from the content-addressed store, hash-verified

27924 bounds of this \ref QCPErrorBars instance and the bounds of the data plottable.
27925*/
27926bool QCPErrorBars::errorBarVisible(int index) const
27927{
27928 QPointF centerPixel = mDataPlottable->interface1D()->dataPixelPosition(index);
27929 const double centerKeyPixel = mKeyAxis->orientation() == Qt::Horizontal ? centerPixel.x() : centerPixel.y();
27930 if (qIsNaN(centerKeyPixel))
27931 return false;
27932
27933 double keyMin, keyMax;
27934 if (mErrorType == etKeyError)
27935 {
27936 const double centerKey = mKeyAxis->pixelToCoord(centerKeyPixel);
27937 const double errorPlus = mDataContainer->at(index).errorPlus;
27938 const double errorMinus = mDataContainer->at(index).errorMinus;
27939 keyMax = centerKey+(qIsNaN(errorPlus) ? 0 : errorPlus);
27940 keyMin = centerKey-(qIsNaN(errorMinus) ? 0 : errorMinus);
27941 } else // mErrorType == etValueError
27942 {
27943 keyMax = mKeyAxis->pixelToCoord(centerKeyPixel+mWhiskerWidth*0.5*mKeyAxis->pixelOrientation());
27944 keyMin = mKeyAxis->pixelToCoord(centerKeyPixel-mWhiskerWidth*0.5*mKeyAxis->pixelOrientation());
27945 }
27946 return ((keyMax > mKeyAxis->range().lower) && (keyMin < mKeyAxis->range().upper));
27947}
27948
27949/*! \internal
27950

Callers

nothing calls this directly

Calls 4

pixelToCoordMethod · 0.80
rangeMethod · 0.80
dataPixelPositionMethod · 0.45
atMethod · 0.45

Tested by

no test coverage detected