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

Method createSubTickVector

3rdparty/qcustomplot/qcustomplot.cpp:6311–6325  ·  view source on GitHub ↗

! \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

Source from the content-addressed store, hash-verified

6309 base its result on \a subTickCount or \a ticks.
6310*/
6311QVector<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

Callers

nothing calls this directly

Calls 4

appendMethod · 0.80
sizeMethod · 0.45
reserveMethod · 0.45
atMethod · 0.45

Tested by

no test coverage detected