| 655 | } |
| 656 | |
| 657 | vector<Segment> ProcessJoints(vector<JointSegment> const & jointsPath, |
| 658 | IndexGraphStarterJoints<IndexGraphStarter> & jointStarter) |
| 659 | { |
| 660 | CHECK(!jointsPath.empty(), ()); |
| 661 | |
| 662 | vector<Segment> path; |
| 663 | for (auto const & joint : jointsPath) |
| 664 | { |
| 665 | vector<Segment> jointPath = jointStarter.ReconstructJoint(joint); |
| 666 | if (jointPath.empty()) |
| 667 | continue; |
| 668 | |
| 669 | if (path.empty()) |
| 670 | { |
| 671 | path = std::move(jointPath); |
| 672 | continue; |
| 673 | } |
| 674 | |
| 675 | auto begIter = jointPath.begin(); |
| 676 | if (path.back() == jointPath.front()) |
| 677 | ++begIter; |
| 678 | path.insert(path.end(), begIter, jointPath.end()); |
| 679 | } |
| 680 | |
| 681 | return path; |
| 682 | } |
| 683 | |
| 684 | RouterResultCode IndexRouter::CalculateSubroute(Checkpoints const & checkpoints, size_t subrouteIdx, |
| 685 | RouterDelegate const & delegate, |