MCPcopy Index your code
hub / github.com/Audio4Linux/JDSP4Linux / createTickVector

Method createTickVector

3rdparty/qcustomplot/qcustomplot.cpp:6342–6354  ·  view source on GitHub ↗

! \internal Returns a vector containing all coordinates of ticks that should be drawn. The default implementation generates ticks with a spacing of \a tickStep (mathematically starting at the tick step origin, see \ref setTickOrigin) distributed over the passed \a range. In order for the axis ticker to generate proper sub ticks, it is necessary that the first and last tick coordina

Source from the content-addressed store, hash-verified

6340 QCPAxisTickerLog.
6341*/
6342QVector<double> QCPAxisTicker::createTickVector(double tickStep, const QCPRange &range)
6343{
6344 QVector<double> result;
6345 // Generate tick positions according to tickStep:
6346 qint64 firstStep = qint64(floor((range.lower-mTickOrigin)/tickStep)); // do not use qFloor here, or we'll lose 64 bit precision
6347 qint64 lastStep = qint64(ceil((range.upper-mTickOrigin)/tickStep)); // do not use qCeil here, or we'll lose 64 bit precision
6348 int tickcount = int(lastStep-firstStep+1);
6349 if (tickcount < 0) tickcount = 0;
6350 result.resize(tickcount);
6351 for (int i=0; i<tickcount; ++i)
6352 result[i] = mTickOrigin + (firstStep+i)*tickStep;
6353 return result;
6354}
6355
6356/*! \internal
6357

Callers

nothing calls this directly

Calls 9

resizeMethod · 0.80
constBeginMethod · 0.80
constEndMethod · 0.80
appendMethod · 0.80
floorFunction · 0.50
ceilFunction · 0.50
isEmptyMethod · 0.45
sizeMethod · 0.45
atMethod · 0.45

Tested by

no test coverage detected