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

routing_settings.hpp « routing - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: fffe554a502cce6f22caaa4c4c44183c9b755cb9 (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
54
55
56
57
58
59
60
#pragma once

#include "std/utility.hpp"

namespace routing
{

/// \brief The RoutingSettings struct is intended to collect all the settings of
/// following along the route.
/// For example, route matching properties, rerouting properties and so on.
struct RoutingSettings
{
  /// \brief if m_matchRoute is equal to true the bearing follows the
  /// route direction if the current position is matched to the route.
  /// If m_matchRoute is equal to false GPS bearing is used while
  /// the current position is matched to the route.
  bool    m_matchRoute;
  /// \brief if m_soundDirection is equal to true an end user gets sound notification
  /// before directions.
  bool    m_soundDirection;

  /// \brief m_matchingThresholdM is half width of the passage around the route
  /// for route matching in meters. That means if a real current position is closer than
  /// m_matchingThresholdM to the route than the current position is moved to
  /// the closest point to the route.
  double  m_matchingThresholdM;

  /// \brief m_keepPedestrianInfo flag for keeping in memory additional information for pedestrian
  /// routing.
  bool m_keepPedestrianInfo;

  /// \brief if m_showTurnAfterNext is equal to true end users see a notification
  /// about the turn after the next in some cases.
  bool m_showTurnAfterNext;

  /// \brief m_speedCameraWarning is a flag for enabling user notifications about speed cameras.
  bool m_speedCameraWarning;
};

inline RoutingSettings GetPedestrianRoutingSettings()
{
  return RoutingSettings({ false /* m_matchRoute */, false /* m_soundDirection */,
                           20. /* m_matchingThresholdM */, true /* m_keepPedestrianInfo */,
                           false /* m_showTurnAfterNext */, false /* m_speedCameraWarning*/});
}

inline RoutingSettings GetCarRoutingSettings()
{
  return RoutingSettings({ true /* m_matchRoute */, true /* m_soundDirection */,
                           50. /* m_matchingThresholdM */, false /* m_keepPedestrianInfo */,
                           true /* m_showTurnAfterNext */, true /* m_speedCameraWarning*/});
}

inline RoutingSettings GetBicycleRoutingSettings()
{
  return RoutingSettings({ true /* m_matchRoute */, true /* m_soundDirection */,
                           30. /* m_matchingThresholdM */, false /* m_keepPedestrianInfo */,
                           false /* m_showTurnAfterNext */, false /* m_speedCameraWarning*/});
}
}  // namespace routing