MCPcopy Create free account
hub / github.com/Audio4Linux/JDSP4Linux / errorBarVisible

Method errorBarVisible

3rdparty/qcustomplot/qcustomplot.cpp:28806–28827  ·  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 \c nullptr 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

28804 valid bounds of this \ref QCPErrorBars instance and the bounds of the data plottable.
28805*/
28806bool 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

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected