All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Route.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 #include "Types.h"
6 #include "Streaming.h"
7 #include "Routes.h"
8 #include "ClippedRoute.h"
9 #include "RouteVertex.h"
10 #include <vector>
11 
12 namespace Eegeo
13 {
14  namespace Routes
15  {
16  class Route : public Eegeo::NonCopyable
17  {
18  std::vector<RouteVertex> m_points;
19 
20  Clipping::ClippedRoute m_routeClippedToCells;
21 
22  bool m_fittingToNavigationGraphEnabled;
23  bool m_projectToTerrain;
24 
25  public:
26  Route(const std::vector<RouteVertex>& clippedRouteVertices,
27  const Clipping::ClippedRoute& routeClippedToCells,
28  bool fittingToNavigationGraphEnabled,
29  bool projectToTerrain
30  );
31 
32  const std::vector<RouteVertex>& GetPoints() const;
33 
34  void GetCoveredKeys(std::vector<Streaming::MortonKey>& coverage) const;
35 
36  bool TryGetClippedRouteSectionsForCell(const Streaming::MortonKey& key, std::vector<Clipping::ClippedRouteSection>& sections) const;
37 
38  bool HasClippedRouteSectionForCell(const Streaming::MortonKey& key) const;
39 
40  const std::vector<Clipping::ClippedRouteSection>& GetClippedRouteSectionsForCell(const Streaming::MortonKey& key) const;
41 
42  void GetClippedRouteSectionsForCells(const std::vector<Streaming::MortonKey>& keys, std::vector<Clipping::ClippedRouteSection>& out_clippedRouteSections) const;
43 
44  bool GetFittingToNavigationGraphEnabled() const;
45 
46  double GetLength() const;
47 
48  bool ShouldProjectToTerrain() const;
49 
50  static int FindRouteVertexIndexImmediatelyBefore(const std::vector<RouteVertex>& routeVertices, const double routeParam);
51 
52  static RouteVertex GetInterpolatedRouteVertex(const std::vector<RouteVertex>& routeVertices, const double routeParam, v3& out_direction);
53 
54  static double DistanceToRoute(const std::vector<RouteVertex>& routeVertices, const dv3& pointEcef, double& out_paramAtClosestApproach, int& out_indexImmediatelyBefore);
55  };
56  }
57 }