All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
InteriorsMaterialsModule.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 #include "InteriorsMaterials.h"
6 #include "Modules.h"
7 #include "AsyncTexturing.h"
8 #include "Helpers.h"
9 #include "Interiors.h"
10 #include "Rendering.h"
11 #include "CityThemes.h"
12 #include "AsyncTexturing.h"
13 #include "Collision.h"
14 #include "IdTypes.h"
15 #include "Lighting.h"
16 #include "Helpers.h"
17 #include "Types.h"
18 #include "Web.h"
19 #include <vector>
20 #include <string>
21 
22 namespace Eegeo
23 {
24  namespace Modules
25  {
26  namespace Map
27  {
28  namespace Layers
29  {
31  {
32  public:
39  Resources::Interiors::InteriorsModelRepository& interiorsModelRepository,
42  Resources::Interiors::Materials::IInteriorsMaterialProviderFactory& dynamicallyLoadedInteriorMaterialService,
43  Collision::CollisionMeshResourceRepository& collisionMeshResourceRepository,
44  Collision::CollisionMeshResourceRepository& highlightCollisionMeshResourceRepository,
45  Resources::Interiors::InteriorsCellResourceObserver& interiorsCellResourceObserver,
46  Rendering::Shaders::ShaderIdGenerator& shaderIdGenerator,
47  Rendering::Materials::MaterialIdGenerator& materialIdGenerator,
48  const Lighting::GlobalLighting& globalLighting,
49  const bool interiorsEnabled,
51  Eegeo::Web::IWebLoadRequestFactory& webLoadRequestFactory,
53  const Helpers::ITimeProvider& timeProvider);
54 
56 
57  static InteriorsMaterialsModule* Create(Modules::Core::RenderingModule& renderingModule,
58  Modules::Map::Layers::InteriorsModelModule& interiorsModelModule,
59  Modules::Core::LightingModule& lightingModule,
60  Modules::Core::AsyncLoadersModule& asyncLoadersModule,
61  Resources::Interiors::Materials::IInteriorsMaterialProviderFactory& dynamicallyLoadedInteriorMaterialService,
62  CityThemesModule& cityThemesModule,
63  Web::IWebLoadRequestFactory& webLoadRequestFactory,
65  const Helpers::ITimeProvider& timeProvider,
66  const bool interiorsEnabled);
67 
68  Resources::Interiors::IInteriorsMaterialService& GetInteriorsMaterialService() const;
69 
70  Resources::Interiors::IInteriorsMaterialAssignmentObserver& GetInteriorsMaterialAssignmentObserver() const;
71 
72  Resources::Interiors::Materials::IInteriorsMaterialDtoRepository& GetInteriorsMaterialDtoRepository() const;
73 
74  Resources::Interiors::InteriorsStencilMirrorClearRenderableFactory& GetInteriorsStencilMirrorClearRenderableFactory() const;
75 
76  Resources::Interiors::IInteriorsTextureResourceService& GetInteriorsTextureResourceService() const;
77 
78  Resources::Interiors::Materials::IInteriorRenderablesRepository& GetInteriorRenderablesRepository() const;
79 
80  private:
81 
82  bool TryGetLocalMaterialsJson(Eegeo::Helpers::IFileIO& fileIO,
83  std::string& materialsJson);
84 
85  void AddLocalMaterials(const std::string& materialsJson,
88 
89  Rendering::IMaterialRepository& GetInteriorsMaterialRepository() const;
90 
91  const Resources::Interiors::InteriorsShader& GetInteriorsShader() const;
92 
93  const Resources::Interiors::InteriorsDiffuseTexturedShader& GetInteriorsDiffuseTexturedShader() const;
94 
95  const Resources::Interiors::InteriorsDiffuseSpecularShader& GetInteriorsDiffuseSpecularShader() const;
96 
97  const Resources::Interiors::InteriorsCubeMappedShader& GetInteriorsCubeMappedShader() const;
98 
99  const Resources::Interiors::InteriorsChromeShader& GetInteriorsChromeShader() const;
100 
101  Resources::Interiors::InteriorsStencilMirrorClearMaterial* m_pInteriorsStencilMirrorClearMaterial;
102  Eegeo::Rendering::Mesh* m_pFullScreenQuadMesh;
103  Resources::Interiors::InteriorsStencilMirrorClearRenderableFactory* m_pInteriorsStencilMirrorClearRenderableFactory;
104 
105  Resources::Interiors::IInteriorsMaterialService* m_pInteriorsMaterialService;
106  Rendering::IMaterialRepository* m_pInteriorsMaterialRepository;
107 
108  Resources::Interiors::Materials::IInteriorsMaterialFactoryProvider* m_pInteriorsMaterialFactoryProvider;
109 
110  Resources::Interiors::IInteriorsTextureResourceBuilder* m_pInteriorsTextureResourceBuilder;
111  Resources::Interiors::IInteriorsCubeTextureResourceBuilder* m_pInteriorsCubeTextureResourceBuilder;
112 
113  Resources::Interiors::InteriorsTextureResourceService* m_pInteriorsTextureResourceService;
114  Resources::Interiors::IInteriorsMaterialAssignmentObserver* m_pInteriorsMaterialAssignmentObserver;
115  Resources::Interiors::Materials::IInteriorsMaterialDtoRepository* m_pInteriorsMaterialDtoRepository;
116 
117  Resources::Interiors::Materials::InteriorsMaterialDescriptorLoader* m_pInteriorsMaterialDescriptorLoader;
118  Resources::Interiors::Materials::InteriorsModelAddedObserver* m_pInteriorsModelAddedObserver;
119  Resources::Interiors::Materials::InteriorsModelRemovedObserver* m_pInteriorsModelRemovedObserver;
120  Resources::Interiors::Materials::InteriorRenderablesRepository* m_pInteriorRenderablesRepository;
121  };
122  }
123  }
124  }
125 }