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

Method createTickVector

qcustomplot.cpp:5715–5727  ·  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

5713 QCPAxisTickerLog.
5714*/
5715QVector<double> QCPAxisTicker::createTickVector(double tickStep, const QCPRange &range)
5716{
5717 QVector<double> result;
5718 // Generate tick positions according to tickStep:
5719 qint64 firstStep = floor((range.lower-mTickOrigin)/tickStep); // do not use qFloor here, or we'll lose 64 bit precision
5720 qint64 lastStep = ceil((range.upper-mTickOrigin)/tickStep); // do not use qCeil here, or we'll lose 64 bit precision
5721 int tickcount = lastStep-firstStep+1;
5722 if (tickcount < 0) tickcount = 0;
5723 result.resize(tickcount);
5724 for (int i=0; i<tickcount; ++i)
5725 result[i] = mTickOrigin + (firstStep+i)*tickStep;
5726 return result;
5727}
5728
5729/*! \internal
5730

Callers

nothing calls this directly

Calls 6

atMethod · 0.80
constBeginMethod · 0.80
constEndMethod · 0.80
appendMethod · 0.80
isEmptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected