All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
StreamingModule.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 #include <vector>
6 
7 #include "Types.h"
8 #include "Modules.h"
9 #include "Streaming.h"
10 #include "Web.h"
11 #include "SceneGraphCellRepository.h"
12 #include "Helpers.h"
13 #include "Tasks.h"
14 #include "Camera.h"
15 #include "Terrain.h"
16 #include "Buildings.h"
17 #include "Rendering.h"
18 #include "CityThemes.h"
19 #include "AsyncTexturing.h"
20 #include "AsyncModels.h"
21 #include "StreamingPipelineVisualiser.h"
22 #include "DebugRendering.h"
23 #include "Config.h"
24 
25 namespace Eegeo
26 {
27  namespace Modules
28  {
29  namespace Map
30  {
32  {
33  public:
35  Eegeo::Helpers::IHttpCache& httpCache,
44  size_t resourceNodeCacheEntries,
45  Web::WebConnectivityValidator& webConnectivityValidator,
46  const int webReqestTimeoutSeconds
47  );
48 
49  ~StreamingModule();
50 
51  static StreamingModule* Create(Core::AsyncLoadersModule& asyncLoadersModule,
52  Core::SceneModelsModule& sceneModelsModule,
53  Map::Layers::TerrainStreamingModule& terrainStreamingModule,
54  Map::CityThemesModule& cityThemesModule,
55  Web::IWebLoadRequestFactory& webLoadRequestFactory,
56  Helpers::IHttpCache& httpCache,
60  size_t resourceNodeCacheEntries,
61  Web::WebConnectivityValidator& webConnectivityValidator,
62  const Eegeo::Config::StreamingConfigSection& streamingConfig);
63 
64  Web::PrecacheService& GetPrecachingService() const { return *m_pPrecachingService; }
65 
66  Streaming::StreamingController& GetStreamingController() const { return *m_pStreamingController; }
67  Streaming::BuildPrioritiser& GetBuildPrioritiser() const { return *m_pBuildPrioritiser; }
68  Streaming::PayloadBuildManager& GetPayloadBuildManager() const { return *m_pBuildManager; }
69  Streaming::StreamingVolumeController& GetStreamingVolumeController() const { return *m_pStreamingVolumeController; }
70  Streaming::QuadTreeCube& GetQuadTreeCube() const { return *m_pQuadTreeCube; }
71  Streaming::QuadTreeVisibilityUpdater& GetQuadTreeVisibilityUpdater() const { return *m_pQuadTreeVisibilityUpdater; }
72  Streaming::PayloadPriorityComparator& GetPayloadPriorityComparator() const { return *m_pPayloadPriorityComparator; }
73  Streaming::PayloadSlotStreamMap& GetPayloadStreams() const { return *m_pPayloadSlotStreamMap; }
74  Streaming::PayloadPlaceholderBuilder& GetPayloadPlaceholderBuilder() const { return *m_pPayloadPlaceholderBuilder; }
75  Streaming::TerrainPlaceholderInserter& GetTerrainPlaceholderInserter() const { return *m_pTerrainPlaceholderInserter; }
76  Streaming::LoadPrioritiser& GetLoadPrioritiser() const { return *m_pLoadPrioritiser; }
77  Streaming::QuadTreeNodePool& GetQuadTreeNodePool() const { return *m_pNodePool; }
78  Streaming::PayloadPool& GetPayloadPool() const { return *m_pPayloadPool; }
79  Streaming::PayloadEvicter& GetPayloadEvicter() const { return *m_pPayloadEvicter; }
80  Streaming::SceneGraphUpdater& GetSceneGraphUpdater() const { return *m_pSceneGraphUpdater; }
81  Streaming::RedundantNodeEvicter& GetRedundantNodeEvicter() const { return *m_pNodeEvicter; }
82  Streaming::ResourceNodeCache& GetResourceNodeCache() const { return *m_pResourceNodeCache; }
83  Streaming::PayloadWebLoader& GetPayloadWebLoader() const { return *m_pPayloadWebLoader; }
84  Streaming::SceneGraphCellRepository& GetSceneGraphCellRepository() { return m_sceneGraphCellRepository; }
85  Streaming::Debug::StreamingPipelineVisualiser& GetStreamingVisauliser() { return *m_pStreamingVisualiser; }
86 
87  void SetStreams(const std::vector<Eegeo::Streaming::LodStreamMap>& lodStreamMaps);
88 
89  void Update(float dt,
90  const Camera::RenderCamera& renderCamera,
91  const dv3& ecefInterestPoint,
92  Streaming::IStreamingVolume& streamingVolume);
93 
94  void Draw(const Rendering::RenderContext& renderContext);
95 
96  private:
97  Streaming::StreamingController* m_pStreamingController;
98  Streaming::BuildPrioritiser* m_pBuildPrioritiser;
99  Streaming::ResourceNodeCache* m_pResourceNodeCache;
100  Streaming::PayloadBuildManager* m_pBuildManager;
101  Streaming::StreamingVolumeController* m_pStreamingVolumeController;
102  Streaming::QuadTreeCube* m_pQuadTreeCube;
103  Streaming::SceneGraphCellRepository m_sceneGraphCellRepository;
104  Streaming::QuadTreeVisibilityUpdater* m_pQuadTreeVisibilityUpdater;
105  Streaming::PayloadPriorityComparator* m_pPayloadPriorityComparator;
106  Streaming::PayloadSlotStreamMap* m_pPayloadSlotStreamMap;
107  Streaming::PayloadPlaceholderBuilder* m_pPayloadPlaceholderBuilder;
108  Streaming::TerrainPlaceholderInserter* m_pTerrainPlaceholderInserter;
109  Streaming::Debug::StreamingPipelineVisualiser* m_pStreamingVisualiser;
110 
111  Streaming::LoadPrioritiser* m_pLoadPrioritiser;
112  Streaming::QuadTreeNodePool* m_pNodePool;
113  Streaming::PayloadPool* m_pPayloadPool;
114  Streaming::PayloadEvicter* m_pPayloadEvicter;
115  Streaming::SceneGraphUpdater* m_pSceneGraphUpdater;
116  Streaming::RedundantNodeEvicter* m_pNodeEvicter;
117  Streaming::PayloadWebLoader* m_pPayloadWebLoader;
118  Web::PrecacheService* m_pPrecachingService;
119  };
120  }
121  }
122 }