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

turn_candidate.hpp « routing - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d4fb7f4f04fa22f9fc7b69332fb7de0d02717370 (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
#pragma once

#include "routing/turns.hpp"

#include "std/vector.hpp"

namespace ftypes
{
enum class HighwayClass;
}

namespace routing
{
namespace turns
{
/*!
 * \brief The TurnCandidate struct contains information about possible ways from a junction.
 */
struct TurnCandidate
{
  /*!
   * angle is an angle of the turn in degrees. It means angle is 180 minus
   * an angle between the current edge and the edge of the candidate. A counterclockwise rotation.
   * The current edge is an edge which belongs the route and located before the junction.
   * angle belongs to the range [-180; 180];
   */
  double angle;
  /*!
   * |m_nodeId| is a possible node (a possible way) from the juction.
   * |m_nodeId| contain either only unique NodeID for OSRM case or mwm id, feature id, segment id
   * and direction in case of A*.
   */
  UniNodeId m_nodeId;
  /*!
   * \brief highwayClass field for the road class caching. Because feature reading is a long
   * function.
   */
  ftypes::HighwayClass highwayClass;

  TurnCandidate(double a, UniNodeId const & n, ftypes::HighwayClass c)
    : angle(a), m_nodeId(n), highwayClass(c)
  {
  }
};

struct TurnCandidates
{
  vector<TurnCandidate> candidates;
  bool isCandidatesAngleValid;

  explicit TurnCandidates(bool angleValid = true) : isCandidatesAngleValid(angleValid) {}
};

}  // namespace routing
}  // namespace turns