| 157 | }; |
| 158 | |
| 159 | class IndexGraphWrapper final |
| 160 | { |
| 161 | public: |
| 162 | IndexGraphWrapper(IndexGraph & graph, Segment const & start) : m_graph(graph), m_start(start) {} |
| 163 | |
| 164 | /// @name For compatibility with IndexGraphStarterJoints |
| 165 | /// @{ |
| 166 | Segment GetStartSegment() const { return m_start; } |
| 167 | Segment GetFinishSegment() const { return {}; } |
| 168 | bool ConvertToReal(Segment const & /* segment */) const { return false; } |
| 169 | RouteWeight HeuristicCostEstimate(Segment const & /* from */, ms::LatLon const & /* to */) |
| 170 | { |
| 171 | CHECK(false, ("This method exists only for compatibility with IndexGraphStarterJoints")); |
| 172 | return GetAStarWeightZero<RouteWeight>(); |
| 173 | } |
| 174 | |
| 175 | bool AreWavesConnectible(IndexGraph::Parents<JointSegment> const & /* forwardParents */, |
| 176 | JointSegment const & /* commonVertex */, |
| 177 | IndexGraph::Parents<JointSegment> const & /* backwardParents */, |
| 178 | WorldGraph::FakeConverterT const & /* fakeFeatureConverter */) |
| 179 | { |
| 180 | return true; |
| 181 | } |
| 182 | |
| 183 | void SetAStarParents(bool /* forward */, IndexGraph::Parents<JointSegment> & parents) { m_AStarParents = &parents; } |
| 184 | |
| 185 | void DropAStarParents() { m_AStarParents = nullptr; } |
| 186 | |
| 187 | RouteWeight GetAStarWeightEpsilon() { return RouteWeight(0.0); } |
| 188 | |
| 189 | RouteWeight GetCrossBorderPenalty(NumMwmId mwmId1, NumMwmId mwmId2) { return RouteWeight(0); } |
| 190 | /// @} |
| 191 | |
| 192 | ms::LatLon const & GetPoint(Segment const & s, bool forward) { return m_graph.GetPoint(s, forward); } |
| 193 | |
| 194 | using SegmentEdgeListT = IndexGraph::SegmentEdgeListT; |
| 195 | using EdgeListT = SegmentEdgeListT; |
| 196 | void GetEdgesList(Segment const & child, bool isOutgoing, SegmentEdgeListT & edges) |
| 197 | { |
| 198 | m_graph.GetEdgeList(child, isOutgoing, true /* useRoutingOptions */, edges); |
| 199 | } |
| 200 | |
| 201 | using JointEdgeListT = IndexGraph::JointEdgeListT; |
| 202 | using WeightListT = IndexGraph::WeightListT; |
| 203 | |
| 204 | void GetEdgeList(astar::VertexData<JointSegment, RouteWeight> const & vertexData, Segment const & parent, |
| 205 | bool isOutgoing, JointEdgeListT & edges, WeightListT & parentWeights) const |
| 206 | { |
| 207 | CHECK(m_AStarParents, ()); |
| 208 | return m_graph.GetEdgeList(vertexData.m_vertex, parent, isOutgoing, edges, parentWeights, *m_AStarParents); |
| 209 | } |
| 210 | |
| 211 | bool IsJoint(Segment const & segment, bool fromStart) const { return IsJointOrEnd(segment, fromStart); } |
| 212 | |
| 213 | bool IsJointOrEnd(Segment const & segment, bool fromStart) const { return m_graph.IsJointOrEnd(segment, fromStart); } |
| 214 | |
| 215 | template <typename Vertex> |
| 216 | RouteWeight HeuristicCostEstimate(Vertex const & /* from */, m2::PointD const & /* to */) |