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

Method errorBarVisible

qcustomplot.cpp:28016–28037  ·  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

28014 bounds of this \ref QCPErrorBars instance and the bounds of the data plottable.
28015*/
28016bool QCPErrorBars::errorBarVisible(int index) const
28017{
28018 QPointF centerPixel = mDataPlottable->interface1D()->dataPixelPosition(index);
28019 const double centerKeyPixel = mKeyAxis->orientation() == Qt::Horizontal ? centerPixel.x() : centerPixel.y();
28020 if (qIsNaN(centerKeyPixel))
28021 return false;
28022
28023 double keyMin, keyMax;
28024 if (mErrorType == etKeyError)
28025 {
28026 const double centerKey = mKeyAxis->pixelToCoord(centerKeyPixel);
28027 const double errorPlus = mDataContainer->at(index).errorPlus;
28028 const double errorMinus = mDataContainer->at(index).errorMinus;
28029 keyMax = centerKey+(qIsNaN(errorPlus) ? 0 : errorPlus);
28030 keyMin = centerKey-(qIsNaN(errorMinus) ? 0 : errorMinus);
28031 } else // mErrorType == etValueError
28032 {
28033 keyMax = mKeyAxis->pixelToCoord(centerKeyPixel+mWhiskerWidth*0.5*mKeyAxis->pixelOrientation());
28034 keyMin = mKeyAxis->pixelToCoord(centerKeyPixel-mWhiskerWidth*0.5*mKeyAxis->pixelOrientation());
28035 }
28036 return ((keyMax > mKeyAxis->range().lower) && (keyMin < mKeyAxis->range().upper));
28037}
28038
28039/*! \internal
28040

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected