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

pedestrian_model.hpp « routing - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 2859601930e368f5b391c33acf4892b3b89298b4 (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
42
43
44
45
46
47
48
49
50
51
52
53
#pragma once

#include "std/shared_ptr.hpp"
#include "std/unordered_map.hpp"

#include "vehicle_model.hpp"

namespace routing
{

class PedestrianModel : public VehicleModel
{
public:
  PedestrianModel();
  PedestrianModel(VehicleModel::InitListT const & speedLimits);

  /// @name Overrides from VehicleModel.
  //@{
  double GetSpeed(FeatureType const & f) const override;
  bool IsOneWay(FeatureType const &) const override { return false; }
  //@}

private:
  void Init();

  /// @return True if road is prohibited for pedestrian,
  /// but if function returns False, real prohibition is unknown.
  bool IsNoFoot(feature::TypesHolder const & types) const;

  /// @return True if road is allowed for pedestrian,
  /// but if function returns False, real allowance is unknown.
  bool IsYesFoot(feature::TypesHolder const & types) const;

  uint32_t m_noFootType;
  uint32_t m_yesFootType;
};

class PedestrianModelFactory : public IVehicleModelFactory
{
public:
  PedestrianModelFactory();

  /// @name Overrides from IVehicleModelFactory.
  //@{
  shared_ptr<IVehicleModel> GetVehicleModel() const override;
  shared_ptr<IVehicleModel> GetVehicleModelForCountry(string const & country) const override;
  //@}

private:
  unordered_map<string, shared_ptr<IVehicleModel>> m_models;
};

}  // namespace routing