添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接


QVector<QPointF> ReadSonicPoint::sortSonicPoint(QVector<QPointF> befPointVector) //把x轴的值从小到大排序
{
QVector<QPointF> modPointVector;
QMap<double, double>sonicMap; //利用QMap自动排序
for (int i = 0; i < befPointVector.size(); i++)
{
sonicMap.insert(befPointVector[i].x(), befPointVector[i].y());
}
QMap<double, double>::Iterator it = sonicMap.begin();
while (it!=sonicMap.end())
{
QPointF sonicPoint;
sonicPoint.setX(it.key());
sonicPoint.setY(it.value());
modPointVector.append(sonicPoint);
i++;
}
return modPointVector;
}