! This is the method called by QCPAxis in order to actually generate tick coordinates (\a ticks), tick label strings (\a tickLabels) and sub tick coordinates (\a subTicks). The ticks are generated for the specified \a range. The generated labels typically follow the specified \a locale, \a formatChar and number \a precision, however this might be different (or even irrelevant) for cer
| 6184 | to \a ticks by index. |
| 6185 | */ |
| 6186 | void QCPAxisTicker::generate(const QCPRange &range, const QLocale &locale, QChar formatChar, int precision, QVector<double> &ticks, QVector<double> *subTicks, QVector<QString> *tickLabels) |
| 6187 | { |
| 6188 | // generate (major) ticks: |
| 6189 | double tickStep = getTickStep(range); |
| 6190 | ticks = createTickVector(tickStep, range); |
| 6191 | trimTicks(range, ticks, true); // trim ticks to visible range plus one outer tick on each side (incase a subclass createTickVector creates more) |
| 6192 | |
| 6193 | // generate sub ticks between major ticks: |
| 6194 | if (subTicks) |
| 6195 | { |
| 6196 | if (!ticks.isEmpty()) |
| 6197 | { |
| 6198 | *subTicks = createSubTickVector(getSubTickCount(tickStep), ticks); |
| 6199 | trimTicks(range, *subTicks, false); |
| 6200 | } else |
| 6201 | *subTicks = QVector<double>(); |
| 6202 | } |
| 6203 | |
| 6204 | // finally trim also outliers (no further clipping happens in axis drawing): |
| 6205 | trimTicks(range, ticks, false); |
| 6206 | // generate labels for visible ticks if requested: |
| 6207 | if (tickLabels) |
| 6208 | *tickLabels = createLabelVector(ticks, locale, formatChar, precision); |
| 6209 | } |
| 6210 | |
| 6211 | /*! \internal |
| 6212 |
no test coverage detected