Welcome to mirror list, hosted at ThFree Co, Russian Federation.

road_graph_builder.hpp « routing_tests « routing - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 12fe8663eff84a2275205a211c9aad12e527fc01 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#pragma once

#include "routing/road_graph.hpp"

#include "routing_common/maxspeed_conversion.hpp"
#include "routing_common/vehicle_model.hpp"

#include <utility>
#include <vector>

namespace routing_test
{

class RoadGraphMockSource : public routing::IRoadGraph
{
public:
  void AddRoad(RoadInfo && ri);

  inline size_t GetRoadCount() const { return m_roads.size(); }

  // routing::IRoadGraph overrides:
  RoadInfo GetRoadInfo(FeatureID const & f, routing::SpeedParams const & speedParams) const override;
  double GetSpeedKMpH(FeatureID const & featureId,
                      routing::SpeedParams const & speedParams) const override;
  double GetMaxSpeedKMpH() const override;
  void ForEachFeatureClosestToCross(m2::PointD const & cross,
                                    ICrossEdgesLoader & edgeLoader) const override;
  void GetFeatureTypes(FeatureID const & featureId, feature::TypesHolder & types) const override;
  void GetJunctionTypes(routing::Junction const & junction, feature::TypesHolder & types) const override;
  routing::IRoadGraph::Mode GetMode() const override;

private:
  std::vector<RoadInfo> m_roads;
};

FeatureID MakeTestFeatureID(uint32_t offset);

void InitRoadGraphMockSourceWithTest1(RoadGraphMockSource & graphMock);
void InitRoadGraphMockSourceWithTest2(RoadGraphMockSource & graphMock);

}  // namespace routing_test