| 110 | } |
| 111 | |
| 112 | void IndexGraph::GetLastPointsForJoint(SegmentListT const & children, bool isOutgoing, PointIdListT & lastPoints) const |
| 113 | { |
| 114 | ASSERT(lastPoints.empty(), ()); |
| 115 | |
| 116 | lastPoints.reserve(children.size()); |
| 117 | for (auto const & child : children) |
| 118 | { |
| 119 | uint32_t const startPointId = child.GetPointId(!isOutgoing /* front */); |
| 120 | uint32_t const pointsNumber = GetRoadGeometry(child.GetFeatureId()).GetPointsCount(); |
| 121 | CHECK_LESS(startPointId, pointsNumber, (child)); |
| 122 | |
| 123 | uint32_t endPointId; |
| 124 | // child.IsForward() == isOutgoing |
| 125 | // This is the direction, indicating the end of the road, |
| 126 | // where we should go for building JointSegment. |
| 127 | // You can retrieve such result if bust possible options of |child.IsForward()| and |isOutgoing|. |
| 128 | bool forward = child.IsForward() == isOutgoing; |
| 129 | if (IsRoad(child.GetFeatureId())) |
| 130 | { |
| 131 | endPointId = GetRoad(child.GetFeatureId()).FindNeighbor(startPointId, forward, pointsNumber).second; |
| 132 | } |
| 133 | else |
| 134 | { |
| 135 | // child.GetFeatureId() can be not road in this case: |
| 136 | // -->--> { -->-->--> } --> |
| 137 | // Where { ... } - borders of mwm |
| 138 | // Here one feature, which enter from mwm A to mwm B and then exit from B to A. |
| 139 | // And in mwm B no other feature cross this one, those feature is in geometry |
| 140 | // and absent in roadIndex. |
| 141 | // In this case we just return endPointNumber. |
| 142 | endPointId = forward ? pointsNumber - 1 : 0; |
| 143 | } |
| 144 | |
| 145 | lastPoints.push_back(endPointId); |
| 146 | } |
| 147 | } |
| 148 | |
| 149 | void IndexGraph::GetEdgeList(astar::VertexData<JointSegment, RouteWeight> const & parentVertexData, |
| 150 | Segment const & parent, bool isOutgoing, JointEdgeListT & edges, |
no test coverage detected