All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
MapModule.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 #include <string>
6 #include <vector>
7 
8 #include "Types.h"
9 #include "Modules.h"
10 #include "Rendering.h"
11 #include "Location.h"
12 #include "Camera.h"
13 #include "Streaming.h"
14 #include "Web.h"
15 #include "Helpers.h"
16 #include "Tasks.h"
17 #include "VectorMathDecl.h"
18 #include "DebugRendering.h"
19 #include "Collision.h"
20 #include "Interiors.h"
21 #include "Config.h"
22 #include "CoverageTrees.h"
23 #include "Labels.h"
24 #include "Positioning.h"
25 #include "Markers.h"
26 #include "Text.h"
27 #include "MapLayers.h"
28 #include "Icons.h"
29 #include "Culling.h"
30 #include "ISceneBuilderModuleFactory.h"
31 #include "BlueSphereModule.h"
32 #include "PoiSearch.h"
33 #include "Mapscenes.h"
34 #include "Positioners.h"
35 #include "BlueSphere.h"
36 #include "PoiSearch.h"
37 #include "AlertBox.h"
38 #include "EegeoRootDeclarations.h"
39 #include "Profile.h"
40 #include "MapCamera.h"
41 #include "Transport.h"
42 #include "PropStreamingService.h"
43 #include "ChunkedFileFormat.h"
44 #include "PropModule.h"
45 #include "IndoorMapEntityInformation.h"
46 #include "IndoorMapFloorOutlineInformation.h"
47 #include "FeatureInteraction.h"
48 
49 namespace Eegeo
50 {
51  namespace Modules
52  {
53  namespace Map
54  {
55  class MapModule : protected Eegeo::NonCopyable
56  {
57  public:
58 
59  ~MapModule();
60 
61  static MapModule* Create(
62  Modules::IPlatformAbstractionModule& platformAbstractionModule,
63  Modules::Core::CoreModule& coreModule,
64  UI::NativeAlerts::IAlertBoxFactory& alertBoxFactory,
65  IEegeoErrorHandler* pErrorHandler,
67  const Config::PlatformConfig& platformConfig,
68  const Rendering::ScreenProperties& screenProperties,
69  const size_t resourceNodeCacheEntries,
70  const std::vector<double>& altitudes,
71  const Web::ApiTokenModel& apiTokenModel,
72  Web::ApiTokenService& apiTokenService,
73  Web::WebConnectivityValidator& webConnectivityValidator,
74  Location::ILocationService& locationService,
75  const Helpers::ITimeProvider& timeProvider);
76 
77 
78  bool IsRunning() const { return m_running; }
79  void Start();
80  void EarlyUpdate(float dt);
81  void Update(float dt,
82  const Camera::RenderCamera& renderCamera,
83  const dv3& ecefInterestPoint,
84  Streaming::IStreamingVolume& streamingVolume,
86 
87  Rendering::EnvironmentFlatteningService& GetEnvironmentFlatteningService() const;
88  Streaming::CameraFrustumStreamingVolume& GetStreamingVolume() const;
89  Streaming::ResourceCeilingProvider& GetResourceCeilingProvider() const;
90  Eegeo::Collision::AggregateCollisionBvhProvider& GetAggregateCollisionBvhProvider() const;
91 
92  WeatherModule& GetWeatherModule() const;
93  CityThemesModule& GetCityThemesModule() const;
94  CoverageTreeModule& GetCoverageTreeModule() const;
95  Layers::PlaceNamesModelModule& GetPlaceNamesModelModule() const;
96  Layers::PlaceNamesPresentationModule& GetPlaceNamesPresentationModule() const;
97  Layers::PlaceNamesStreamingModule& GetPlaceNamesStreamingModule() const;
98  EnvironmentMaterialModule& GetEnvironmentMaterialModule() const;
99  StreamingModule& GetStreamingModule() const;
100  Location::LocationModule& GetLocationModule() const;
101  Layers::BuildingModelModule& GetBuildingModelModule() const;
102  Layers::BuildingStreamingModule& GetBuildingStreamingModule() const;
103  Layers::BuildingPresentationModule& GetBuildingPresentationModule() const;
104  Layers::TransportStreamingModule& GetTransportStreamingModule() const;
105  Layers::TransportModelModule& GetTransportModelModule() const;
106  Layers::TransportPresentationModule& GetTransportPresentationModule() const;
107  Layers::TerrainStreamingModule& GetTerrainStreamingModule() const;
108  Layers::TerrainModelModule& GetTerrainModelModule() const;
109  Layers::TerrainPresentationModule& GetTerrainPresentationModule() const;
110  Layers::ShadowModelModule& GetShadowModelModule() const;
111  Layers::ShadowPresentationModule& GetShadowPresentationModule() const;
112  Resources::Interiors::MetaData::InteriorMetaDataModule& GetInteriorMetaDataModule() const;
113  Modules::ISceneBuilderModule& GetSceneBuilderModule() const;
114 
115  Layers::InteriorsModelModule& GetInteriorsModelModule() const;
116  Layers::InteriorsStreamingModule& GetInteriorsStreamingModule() const;
117  Layers::InteriorsMaterialsModule& GetInteriorsMaterialsModule() const;
118  Layers::InteriorsPresentationModule& GetInteriorsPresentationModule() const;
119  IndoorMapEntityInformation::IndoorMapEntityInformationModule& GetIndoorMapEntityInformationModule() const;
120  IndoorMapFloorOutlineInformation::IndoorMapFloorOutlineInformationModule& GetIndoorMapFloorOutlineInformationModule() const;
121  Layers::PropModule& GetPropModule() const;
122  Labels::LabelsModule& GetLabelsModule() const;
123  MapLayers::MapLayersModule& GetMapLayersModule() const;
124  Markers::MarkersModule& GetMarkersModule() const;
125  Positioning::PositioningModule& GetPositioningModule() const;
126  Positioners::PositionerModule& GetPositionerModule() const;
127  Transport::TransportModule& GetTransportModule() const;
128  BlueSphere::BlueSphereModule& GetBlueSphereModule() const;
129  PoiSearch::PoiSearchModule& GetPoiSearchModule() const;
130  Mapscenes::MapscenesModule& GetMapscenesModule() const;
131  Camera::MapCamera::MapCameraModule& GetMapCameraModule() const;
132  FeatureInteraction::FeatureInteractionModule& GetFeatureInteractionModule() const;
133 
134  private:
135 
136  MapModule(
137  WeatherModule* pWeatherModule,
138  EnvironmentMaterialModule* pEnvironmentMaterialModule,
139  CityThemesModule* pCityThemesModule,
140  Labels::LabelsModule* pLabelsModule,
141  Positioning::PositioningModule* pPositioningModule,
142  Markers::MarkersModule* pMarkersModule,
143  PoiSearch::PoiSearchModule* pPoiSearchModule,
144  Mapscenes::MapscenesModule* pMapscenesModule,
145  StreamingModule* pStreamingModule,
146  CoverageTreeModule* pCoverageTreeModule,
147  Culling::CullingVolumeVisibilityUpdater* pCullingVolumeVisibilityUpdater,
148  Layers::TransportStreamingModule* pTransportStreamingModule,
149  Layers::TransportModelModule* pTransportModelModule,
150  Layers::TransportPresentationModule* pTransportPresentationModule,
151  Layers::PlaceNamesStreamingModule* pPlaceNamesStreamingModule,
152  Layers::PlaceNamesPresentationModule* pPlaceNamesPresentationModule,
153  Layers::PlaceNamesModelModule* pPlaceNamesModelModule,
154  Layers::BuildingModelModule* pBuildingModelModule,
155  Layers::BuildingStreamingModule* pBuildingStreamingModule,
156  Layers::BuildingPresentationModule* pBuildingPresentationModule,
157  Layers::TerrainStreamingModule* pTerrainStreamingModule,
158  Layers::TerrainModelModule* pTerrainModelModule,
159  Layers::TerrainPresentationModule* pTerrainPresentationModule,
161  Layers::InteriorsModelModule* pInteriorsModelModule,
162  Layers::InteriorsPresentationModule* pInteriorsPresentationModule,
163  Layers::InteriorsStreamingModule* pInteriorsStreamingModule,
164  Layers::InteriorsMaterialsModule* pInteriorsMaterialsModule,
165  IndoorMapEntityInformation::IndoorMapEntityInformationModule* pIndoorMapEntityInformationModule,
166  IndoorMapFloorOutlineInformation::IndoorMapFloorOutlineInformationModule* pIndoorMapFloorOutlineInformationModule,
167  Layers::ShadowModelModule* pShadowModelModule,
168  Layers::ShadowPresentationModule* pShadowPresentationModule,
169  Eegeo::Modules::ISceneBuilderModule* pSceneBuilderModule,
170  Eegeo::Modules::IInteriorSceneBuilderModule* pInteriorSceneBuilderModule,
171  Streaming::CameraFrustumStreamingVolume *pStreamingVolume,
172  Streaming::ResourceCeilingProvider* pResourceCeilingProvider,
173  Rendering::EnvironmentFlatteningService* pEnvironmentFlatteningService,
174  Eegeo::Collision::AggregateCollisionBvhProvider* pAggregateCollisionBvhProvider,
175  MapLayers::MapLayersModule* pMapLayersModule,
176  BlueSphere::BlueSphereModule* pBlueSphereModule,
177  Positioners::PositionerModule* pPositionerModule,
178  Transport::TransportModule* pTransportModule,
179  Location::LocationModule* pLocationModule,
180  Camera::MapCamera::MapCameraModule* pMapCameraModule,
181  Layers::PropModule* pPropModule,
182  FeatureInteraction::FeatureInteractionModule* pFeatureInteractionModule,
185  Rendering::RenderableFilters& renderableFilters,
186  const std::string& coverageTreeManifestUrl
187  );
188 
189  WeatherModule* const m_pWeatherModule;
190  EnvironmentMaterialModule* const m_pEnvironmentMaterialModule;
191  CityThemesModule* const m_pCityThemesModule;
192  Labels::LabelsModule* const m_pLabelsModule;
193  Positioning::PositioningModule* const m_pPositioningModule;
194  Markers::MarkersModule* const m_pMarkersModule;
195  PoiSearch::PoiSearchModule* const m_pPoiSearchModule;
196  Mapscenes::MapscenesModule* const m_pMapscenesModule;
197 
198  StreamingModule* const m_pStreamingModule;
199  CoverageTreeModule* const m_pCoverageTreeModule;
200  Culling::CullingVolumeVisibilityUpdater* const m_pCullingVolumeVisibilityUpdater;
201 
202  Layers::TransportStreamingModule* const m_pTransportStreamingModule;
203  Layers::TransportModelModule* const m_pTransportModelModule;
204  Layers::TransportPresentationModule* const m_pTransportPresentationModule;
205 
206  Layers::PlaceNamesStreamingModule* const m_pPlaceNamesStreamingModule;
207  Layers::PlaceNamesPresentationModule* const m_pPlaceNamesPresentationModule;
208  Layers::PlaceNamesModelModule* const m_pPlaceNamesModelModule;
209 
210  Layers::BuildingModelModule* const m_pBuildingModelModule;
211  Layers::BuildingStreamingModule* const m_pBuildingStreamingModule;
212  Layers::BuildingPresentationModule* const m_pBuildingPresentationModule;
213 
214  Layers::TerrainStreamingModule* const m_pTerrainStreamingModule;
215  Layers::TerrainModelModule* const m_pTerrainModelModule;
216  Layers::TerrainPresentationModule* const m_pTerrainPresentationModule;
217 
218  Resources::Interiors::MetaData::InteriorMetaDataModule* const m_pInteriorMetaDataModule;
219  Layers::InteriorsModelModule* const m_pInteriorsModelModule;
220  Layers::InteriorsPresentationModule* const m_pInteriorsPresentationModule;
221  Layers::InteriorsStreamingModule* const m_pInteriorsStreamingModule;
222  Layers::InteriorsMaterialsModule* const m_pInteriorsMaterialsModule;
223 
224  IndoorMapEntityInformation::IndoorMapEntityInformationModule* const m_pIndoorMapEntityInformationModule;
225 
226  IndoorMapFloorOutlineInformation::IndoorMapFloorOutlineInformationModule* const m_pIndoorMapFloorOutlineInformationModule;
227 
228  Layers::ShadowModelModule* const m_pShadowModelModule;
229  Layers::ShadowPresentationModule* const m_pShadowPresentationModule;
230 
231  Eegeo::Modules::ISceneBuilderModule* const m_pSceneBuilderModule;
232  IInteriorSceneBuilderModule* const m_pInteriorSceneBuilderModule;
233 
234  Streaming::CameraFrustumStreamingVolume *const m_pStreamingVolume;
235  Streaming::ResourceCeilingProvider* const m_pResourceCeilingProvider;
236  Rendering::EnvironmentFlatteningService* const m_pEnvironmentFlatteningService;
237 
238  Eegeo::Collision::AggregateCollisionBvhProvider* const m_pAggregateCollisionBvhProvider;
239 
242 
243  MapLayers::MapLayersModule* const m_pMapLayersModule;
244 
245  BlueSphere::BlueSphereModule* const m_pBlueSphereModule;
246  Positioners::PositionerModule* const m_pPositionerModule;
247  Transport::TransportModule* const m_pTransportModule;
248  Location::LocationModule* const m_pLocationModule;
249  Camera::MapCamera::MapCameraModule* const m_pMapCameraModule;
250  Layers::PropModule* const m_pPropModule;
251  FeatureInteraction::FeatureInteractionModule* const m_pFeatureInteractionModule;
252 
253  Rendering::RenderableFilters& m_renderableFilters;
254  const std::string m_coverageTreeManifestUrl;
255  bool m_running;
256 
257  void RegisterRenderableFilters(Rendering::RenderableFilters& renderableFilters) const;
258  void UnregisterRenderableFilters(Rendering::RenderableFilters& renderableFilters) const;
259 
260  void TeardownLayerModelModules();
261 
262  void TeardownLayerPresentationModules();
263 
264  void TeardownLayerStreamingModules();
265 
266  bool IsDeeplinkCoverageTreeSet() const;
267  };
268  }
269  }
270 }
271 
272 
273