! \internal Returns a vector containing all coordinates of sub ticks that should be drawn. It generates \a subTickCount sub ticks between each tick pair given in \a ticks. If a QCPAxisTicker subclass needs maximal control over the generated sub ticks, it should reimplement this method. Depending on the purpose of the subclass it doesn't necessarily need to base its result on \a sub
| 6309 | base its result on \a subTickCount or \a ticks. |
| 6310 | */ |
| 6311 | QVector<double> QCPAxisTicker::createSubTickVector(int subTickCount, const QVector<double> &ticks) |
| 6312 | { |
| 6313 | QVector<double> result; |
| 6314 | if (subTickCount <= 0 || ticks.size() < 2) |
| 6315 | return result; |
| 6316 | |
| 6317 | result.reserve((ticks.size()-1)*subTickCount); |
| 6318 | for (int i=1; i<ticks.size(); ++i) |
| 6319 | { |
| 6320 | double subTickStep = (ticks.at(i)-ticks.at(i-1))/double(subTickCount+1); |
| 6321 | for (int k=1; k<=subTickCount; ++k) |
| 6322 | result.append(ticks.at(i-1) + k*subTickStep); |
| 6323 | } |
| 6324 | return result; |
| 6325 | } |
| 6326 | |
| 6327 | /*! \internal |
| 6328 |