All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
ResourceSpatialQueryService.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 #include "Types.h"
6 #include "Rendering.h"
7 #include "Navigation.h"
8 #include "PlaceNames.h"
9 #include "Roads.h"
10 #include "Streaming.h"
11 #include "VectorMathDecl.h"
12 #include <vector>
13 
14 namespace Eegeo
15 {
16  namespace Resources
17  {
19  {
20  private:
22  typedef std::vector<const TPackedRenderableSceneElement*> TPackedRenderableSceneElementSet;
24 
26  typedef std::vector<const TRoadNamesSceneElement*> TRoadNamesSceneElementSet;
28 
29  typedef std::vector<const PlaceNames::PlaceNameModel*> TPlaceNameModels;
30 
31  const TPackedRenderableSceneElementRepository& m_buildingRepository;
32  const TPackedRenderableSceneElementRepository& m_roadRepository;
33  const TRoadNamesSceneElementRepository& m_roadNamesRepository;
34  const TPackedRenderableSceneElementRepository& m_terrainRepository;
35  const TPackedRenderableSceneElementRepository& m_shadowRepository;
37  const Eegeo::Resources::PlaceNames::PlaceNamesRepository& m_placeNamesRepository;
38 
39  static bool IsBetterDelta(
40  int currentBestDelta,
41  const Streaming::MortonKey& referenceKey,
42  const Streaming::MortonKey& testKey,
43  int& newDelta
44  );
45 
46  static bool IsSameAsBestDelta(
47  int currentBestDelta,
48  const Streaming::MortonKey& referenceKey,
49  const Streaming::MortonKey& testKey,
50  int& newDelta
51  );
52 
53  template<typename T>
54  static std::vector<const Eegeo::Rendering::Scene::SceneElement<T>*> GetItemForKey(
56  const Streaming::MortonKey& key,
57  int lowestLevel,
59 
60  public:
62  const TPackedRenderableSceneElementRepository& buildingRepository,
63  const TPackedRenderableSceneElementRepository& roadRepository,
65  const TPackedRenderableSceneElementRepository& terrainRepository,
66  const TPackedRenderableSceneElementRepository& shadowRepository,
68  const Eegeo::Resources::PlaceNames::PlaceNamesRepository& placeNamesRepository);
69 
70  TPackedRenderableSceneElementSet GetBuildingByEcefPoint(const Eegeo::dv3& ecefPoint,
71  int ecefLevel,
72  int lowestLevel,
73  Streaming::MortonKey& matched) const;
74 
75  TPackedRenderableSceneElementSet GetBuildingByMortonKey(const Eegeo::Streaming::MortonKey& key,
76  int lowestLevel,
77  Streaming::MortonKey& matched) const;
78 
79  TPackedRenderableSceneElementSet GetRoadByEcefPoint(const Eegeo::dv3& ecefPoint,
80  int ecefLevel,
81  int lowestLevel,
82  Streaming::MortonKey& matched) const;
83 
84  TPackedRenderableSceneElementSet GetRoadByMortonKey(const Eegeo::Streaming::MortonKey& key,
85  int lowestLevel,
86  Streaming::MortonKey& matched) const;
87 
88  TPackedRenderableSceneElementSet GetTerrainByEcefPoint(const Eegeo::dv3& ecefPoint,
89  int ecefLevel,
90  int lowestLevel,
91  Streaming::MortonKey& matched) const;
92 
93  TPackedRenderableSceneElementSet GetTerrainByMortonKey(const Eegeo::Streaming::MortonKey& key,
94  int lowestLevel,
95  Streaming::MortonKey& matched) const;
96 
97  TPackedRenderableSceneElementSet GetShadowByEcefPoint(const Eegeo::dv3& ecefPoint,
98  int ecefLevel,
99  int lowestLevel,
100  Streaming::MortonKey& matched) const;
101 
102  TPackedRenderableSceneElementSet GetShadowByMortonKey(const Eegeo::Streaming::MortonKey& key,
103  int lowestLevel,
104  Streaming::MortonKey& matched) const;
105 
106  TRoadNamesSceneElementSet GetRoadNamesByEcefPoint(const Eegeo::dv3& ecefPoint,
107  int ecefLevel,
108  int lowestLevel,
109  Streaming::MortonKey& matched) const;
110 
111  TRoadNamesSceneElementSet GetRoadNamesByMortonKey(const Eegeo::Streaming::MortonKey& key,
112  int lowestLevel,
113  Streaming::MortonKey& matched) const;
114 
115  TPlaceNameModels GetPlaceNamesByEcefPoint(const Eegeo::dv3& ecefPoint,
116  int ecefLevel,
117  int lowestLevel,
118  Streaming::MortonKey& matched) const;
119 
120  TPlaceNameModels GetPlaceNamesByMortonKey(const Eegeo::Streaming::MortonKey& key,
121  int lowestLevel,
122  Streaming::MortonKey& matched) const;
123 
124  Eegeo::Resources::Roads::Navigation::NavigationGraph* GetNavGraphByEcefPoint(const Eegeo::dv3& ecefPoint,
125  int ecefLevel,
126  int lowestLevel,
127  Streaming::MortonKey& matched) const;
128 
130  int lowestLevel,
131  Streaming::MortonKey& matched) const;
132  };
133  }
134 }