! \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
| 6340 | QCPAxisTickerLog. |
| 6341 | */ |
| 6342 | QVector<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 |