All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
RasterTerrainBuilder.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 #include "Types.h"
6 #include "IResourceBuilder.h"
7 #include "Rendering.h"
8 #include "Terrain.h"
9 #include "Streaming.h"
10 #include "IJpegLoader.h"
11 #include "AsyncTexturing.h"
12 #include "ISceneElementInGraphObserver.h"
13 #include "UniqueTextureRenderable.h"
14 
15 namespace Eegeo
16 {
17  namespace Resources
18  {
19  namespace Terrain
20  {
21  namespace Raster
22  {
24  {
25  TerrainBuilderOutput(Rendering::Renderables::UniqueTextureRenderable* renderable, RasterTerrainHeightLookup* rasterTerrainHeightLookup, const std::string& debugName)
26  :renderable(renderable)
27  ,rasterTerrainHeightLookup(rasterTerrainHeightLookup)
28  ,debugName(debugName)
29  {}
30 
32 
33  RasterTerrainHeightLookup* rasterTerrainHeightLookup;
34 
35  const std::string debugName;
36  };
37 
38 
40  {
42  Rendering::IMeshUploadService* m_pMeshUploadService;
43  Rendering::IMaterialProvider& m_materialProvider;
44  Heights::TerrainHeightRepository& m_terrainHeightRepository;
49  Rendering::Renderables::IUniqueTextureRenderableFactory& m_uniqueTextureRenderableFactory;
50 
51  public:
53  Rendering::IMeshUploadService* pMeshUploadService,
54  Rendering::IMaterialProvider& materialProvider,
56  Heights::TerrainHeightRepository& terrainHeightRepository,
60  Rendering::Renderables::IUniqueTextureRenderableFactory& uniqueTextureRenderableFactory)
61  : m_diffuseMeshFactory(diffuseMeshFactory)
62  , m_pMeshUploadService(pMeshUploadService)
63  , m_materialProvider(materialProvider)
64  , m_terrainHeightRepository(terrainHeightRepository)
65  , m_vertexBindingPool(vertexBindingPool)
66  , m_asyncTextureRequestor(asyncTextureRequestor)
67  , m_sceneElementRepository(sceneElementRepository)
68  , m_pWorldSceneGraphObserver(pWorldSceneGraphObserver)
69  , m_uniqueTextureRenderableFactory(uniqueTextureRenderableFactory)
70  { }
71 
72  virtual bool Flush(const Streaming::MortonKey& key, void* input, TBuiltResources& result);
73  virtual void DestroyBuiltResource(const Streaming::MortonKey& key, void* input);
74 
75  virtual void* BuildResource(const Streaming::MortonKey& key, const Byte* data, size_t length);
76  virtual bool AcceptsErroredRequests()
77  {
78  return true;
79  }
80  };
81  }
82  }
83  }
84 }