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

Method getVisibleDataBounds

src/qt/qcustomplot.cpp:21124–21141  ·  view source on GitHub ↗

! This method outputs the currently visible data range via \a begin and \a end. The returned range will also never exceed \a rangeRestriction. This method takes into account that the drawing of data lines at the axis rect border always requires the points just outside the visible axis range. So \a begin and \a end may actually indicate a range that contains one additional data point to

Source from the content-addressed store, hash-verified

21122 axis range.
21123*/
21124void QCPGraph::getVisibleDataBounds(QCPGraphDataContainer::const_iterator &begin, QCPGraphDataContainer::const_iterator &end, const QCPDataRange &rangeRestriction) const
21125{
21126 if (rangeRestriction.isEmpty())
21127 {
21128 end = mDataContainer->constEnd();
21129 begin = end;
21130 } else
21131 {
21132 QCPAxis *keyAxis = mKeyAxis.data();
21133 QCPAxis *valueAxis = mValueAxis.data();
21134 if (!keyAxis || !valueAxis) { qDebug() << Q_FUNC_INFO << "invalid key or value axis"; return; }
21135 // get visible data range:
21136 begin = mDataContainer->findBegin(keyAxis->range().lower);
21137 end = mDataContainer->findEnd(keyAxis->range().upper);
21138 // limit lower/upperEnd to rangeRestriction:
21139 mDataContainer->limitIteratorsToDataRange(begin, end, rangeRestriction); // this also ensures rangeRestriction outside data bounds doesn't break anything
21140 }
21141}
21142
21143/*! \internal
21144

Callers

nothing calls this directly

Calls 15

constEndMethod · 0.80
rangeMethod · 0.80
coordToPixelMethod · 0.80
constBeginMethod · 0.80
boundedMethod · 0.80
isEmptyMethod · 0.45
dataMethod · 0.45
findBeginMethod · 0.45
findEndMethod · 0.45
sortKeyIsMainKeyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected