All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
ParsedNavGraph.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 #include "Types.h"
6 #include "VectorMath.h"
7 #include "FunctionalRoadClass.h"
8 #include <vector>
9 #include <map>
10 #include <string>
11 
12 namespace Eegeo
13 {
14  namespace Resources
15  {
16  namespace Roads
17  {
18  enum RoadDirection
19  {
20  BIDIRECTIONAL = 0,
21  FT = 1,
22  TF = 2,
23  CLOSED_IN_BOTH_DIRECTIONS = 3
24  };
25 
26  void BuildFunctionalRoadClassEnumValuesMap(std::map<std::string,FunctionalRoadClass::Type> &enumMap);
27 
29  {
30  float halfWidth;
31 
32  u8 averageSpeedInKph;
33  u8 roughSpeedLimitInKph;
34  u8 numLanes;
35  RoadDirection direction;
36  FunctionalRoadClass::Type functionalRoadClass;
37 
38  int vertexOffset;
39  int vertexCount;
40  int fromConnectionsOffset;
41  int fromConnectionsCount;
42  int toConnectionsOffset;
43  int toConnectionsCount;
44  };
45 
46  struct NavGraphData
47  {
48  Eegeo::dv3 originECEF;
49  bool hasValidConnectionInformation;
50  std::vector<NavGraphRoadData> roads;
51  std::vector<Eegeo::v3> vertices;
52  std::vector<u16> fromConnections;
53  std::vector<u16> toConnections;
54  std::vector<u16> roadIndicesJoiningCell;
55  std::vector<u16> roadIndicesLeavingCell;
56 
58  const Eegeo::dv3& originECEF_,
59  bool hasValidConnectionInformation_
60  )
61  : originECEF(originECEF_)
62  , hasValidConnectionInformation(hasValidConnectionInformation_)
63  {}
64 
65 
66  void Clear()
67  {
68  originECEF = dv3::Zero();
69  hasValidConnectionInformation = true;
70  roads.clear();
71  vertices.clear();
72  fromConnections.clear();
73  toConnections.clear();
74  roadIndicesJoiningCell.clear();
75  roadIndicesLeavingCell.clear();
76  }
77  };
78  }
79  }
80 }