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

Method findIndexAboveX

qcustomplot.cpp:21560–21573  ·  view source on GitHub ↗

! \internal Finds the smallest index of \a data, whose points x value is just above \a x. Assumes x values in \a data points are ordered ascending, as is ensured by \ref getLines/\ref getScatters if the key axis is horizontal. Used to calculate the channel fill polygon, see \ref getChannelFillPolygon. */

Source from the content-addressed store, hash-verified

21558 Used to calculate the channel fill polygon, see \ref getChannelFillPolygon.
21559*/
21560int QCPGraph::findIndexAboveX(const QVector<QPointF> *data, double x) const
21561{
21562 for (int i=data->size()-1; i>=0; --i)
21563 {
21564 if (data->at(i).x() < x)
21565 {
21566 if (i<data->size()-1)
21567 return i+1;
21568 else
21569 return data->size()-1;
21570 }
21571 }
21572 return -1;
21573}
21574
21575/*! \internal
21576

Callers

nothing calls this directly

Calls 2

atMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected