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

Method createSubTickVector

qcustomplot.cpp:5684–5698  ·  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

5682 base its result on \a subTickCount or \a ticks.
5683*/
5684QVector<double> QCPAxisTicker::createSubTickVector(int subTickCount, const QVector<double> &ticks)
5685{
5686 QVector<double> result;
5687 if (subTickCount <= 0 || ticks.size() < 2)
5688 return result;
5689
5690 result.reserve((ticks.size()-1)*subTickCount);
5691 for (int i=1; i<ticks.size(); ++i)
5692 {
5693 double subTickStep = (ticks.at(i)-ticks.at(i-1))/(double)(subTickCount+1);
5694 for (int k=1; k<=subTickCount; ++k)
5695 result.append(ticks.at(i-1) + k*subTickStep);
5696 }
5697 return result;
5698}
5699
5700/*! \internal
5701

Callers

nothing calls this directly

Calls 3

atMethod · 0.80
appendMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected