All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
NavGraphConformerOutputBuilder.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 #include "Types.h"
6 #include "Routes.h"
7 #include "MortonKey.h"
8 #include "Geometry.h"
9 #include <vector>
10 
11 namespace Eegeo
12 {
13  namespace Routes
14  {
15  namespace Fitting
16  {
17  namespace NavGraphConforming
18  {
20  {
21  public:
23  const Route& route,
24  const NavGraphConforming::ConformerRouteSection& conformerRouteSection,
25  SelectedRoadRepository& selectedRoadRepository,
26  const FittingTerrainProjector& fittingTerrainProjector,
27  const NavGraphConformerConfig& config);
28 
30 
31 
32  void BuildOutput(const std::vector<const CandidateSet*>& candidates,
33  const std::vector<ConformerSolution>& rangeSolutions,
34  std::vector<FittedRouteSection>& out_fittedRouteSections);
35 
36  private:
37  const Eegeo::Streaming::MortonKey m_key;
38  const Route& m_route;
39  const FittingTerrainProjector& m_fittingTerrainProjector;
40  const NavGraphConformerConfig& m_config;
41 
42  Geometry::Point3Spline* m_inputRouteSectionSpline;
43  int m_routeSectionSplineStartIndex;
44 
45 
46  SelectedRoadRepository& m_selectedRoadRepository;
47 
48  void BuildFittedRouteSectionsFromFittedRanges(const std::vector<FittedRangeForRoad>& fittedRanges, std::vector<FittedRouteSection>& out_fittedRouteSections);
49 
50  void BuildFittedRouteSection(const FittedRangeForRoad& fittedRange, std::vector<LocalRouteVertex>& out_localVertices);
51 
52  void BuildUnfittedRouteSection(const FittedRangeForRoad& fittedRange, std::vector<LocalRouteVertex>& out_localVertices);
53 
54  bool CanExtendPreviousFittedRange(const FittedRangeForRoad* fittedRange, const FittedRangeForRoad* prevFittedRange) const;
55 
56  FittedRouteSection CreateFittedRouteSection(const std::vector<LocalRouteVertex>& localVertices);
57 
58  void AssignRouteParams(const std::vector<LocalRouteVertex>& localVertices, std::vector<LocalRouteVertex>& out_localVerticesWithRouteParam) const;
59 
60  void LogFittedRanges(const std::vector<FittedRangeForRoad>& fittedRanges);
61 
62  void ValidateOutput(const std::vector<FittedRouteSection>& fittedRouteSections);
63 
64  double GetRouteParamAtClosestPointOnInputRoute(const v3& position) const;
65  };
66  }
67  }
68  }
69 }