| 394 | } |
| 395 | |
| 396 | std::vector<RouteMarkPoint *> RoutePointsLayout::GetRoutePoints() |
| 397 | { |
| 398 | auto const & markIds = m_manager.GetUserMarkIds(UserMark::Type::ROUTING); |
| 399 | std::vector<RouteMarkPoint *> points; |
| 400 | points.reserve(markIds.size()); |
| 401 | RouteMarkPoint * startPoint = nullptr; |
| 402 | RouteMarkPoint * finishPoint = nullptr; |
| 403 | for (auto markId : markIds) |
| 404 | { |
| 405 | auto * p = m_editSession.GetMarkForEdit<RouteMarkPoint>(markId); |
| 406 | if (p->GetRoutePointType() == RouteMarkType::Start) |
| 407 | startPoint = p; |
| 408 | else if (p->GetRoutePointType() == RouteMarkType::Finish) |
| 409 | finishPoint = p; |
| 410 | else |
| 411 | points.push_back(p); |
| 412 | } |
| 413 | std::sort(points.begin(), points.end(), [](RouteMarkPoint const * p1, RouteMarkPoint const * p2) |
| 414 | { return p1->GetIntermediateIndex() < p2->GetIntermediateIndex(); }); |
| 415 | if (startPoint != nullptr) |
| 416 | points.insert(points.begin(), startPoint); |
| 417 | if (finishPoint != nullptr) |
| 418 | points.push_back(finishPoint); |
| 419 | return points; |
| 420 | } |
| 421 | |
| 422 | size_t RoutePointsLayout::GetRoutePointsCount() const |
| 423 | { |