All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
LabelsModule.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 
6 #include "Types.h"
7 #include "Deprecated.h"
8 #include "Labels.h"
9 #include "Text.h"
10 #include "Modules.h"
11 #include "Rendering.h"
12 #include "Camera.h"
13 #include "IFileIO.h"
14 #include "ICallback.h"
15 #include "Config.h"
16 #include "Icons.h"
17 #include "Streaming.h"
18 #include "LabelsModuleConfiguration.h"
19 
20 #include "LabelAnchorCategoryIconMapLoader.h"
21 
22 #include "LabelSourceController.h"
23 
24 #include <string>
25 #include <vector>
26 
27 namespace Eegeo
28 {
29  namespace Labels
30  {
32  {
33  public:
34  static LabelsModuleConfiguration DefaultConfig();
35 
36  static LabelsModule* Create(Text::ScreenTextRenderingModule& screenTextRenderingModule,
37  Icons::IconsModule& iconsModule,
38  Modules::Core::FontsModule& fontsModule,
39  Modules::Core::DebugRenderingModule& debugRenderingModule,
40  Helpers::IFileIO& fileIO,
41  const Rendering::EnvironmentFlatteningService& environmentFlatteningService,
42  const Rendering::ScreenProperties& screenProperties,
43  const Streaming::ResourceCeilingProvider& resourceCeilingProvider,
44  const Eegeo::Config::PlatformConfig& platformConfig,
45  Modules::ISceneBuilderModule& sceneBuilderModule);
46 
47  ~LabelsModule();
48 
49  void Update(float deltaTime, const Camera::RenderCamera& renderCamera);
50 
51  IAnchoredLabelSourceRepository& GetLabelSourceRepository() const;
52  ILabelAnchorChangedEvent& GetLabelAnchorChangedEvent() const;
53  ILabelModelSourceFactory& GetLabelModelSourceFactory() const;
54  ILabelModelFactory& GetLabelModelFactory() const;
55  ILabelCellResourceObserver& GetLabelCellResourceObserver() const;
56  ILabelOptionsModel& GetLabelOptionsModel() const;
57  ILabelOptionsModelObserver& GetLabelOptionsModelObserver() const;
58  const ILabelFilterModel& GetQueryableLabelLayerFilterModel() const;
59  ILabelFilterModel& GetModifiableLabelLayerFilterModel() const;
60  ILabelLayerFilterGroupModel& GetLabelLayerFilterGroupModel() const;
61  ILabelLayerFilterGroupModelObserver& GetLabelLayerFilterGroupModelObserver() const;
62  ILabelAnchorFilterModel& GetLabelHiddenFilterModel() const;
63  ILabelAnchorFilterModelObserver& GetLabelHiddenFilterModelObserver() const;
64  ILabelAnchorFilterModel& GetPlatformLabelHiddenFilterModel() const;
65  ILabelAnchorCategoryRepository& GetLabelAnchorCategoryRepository() const;
66  ILabelAnchorCategoryIconMapper& GetLabelAnchorCategoryIconMapper() const;
67  ILabelLayerService& GetLabelLayerService() const;
68  ILabelFontBindingService& GetLabelFontBindingService() const;
69  const ILabelStyleRepository& GetLabelStyleRepository() const;
70  ILabelStyleRepositoryObserver& GetLabelStyleRepositoryObserver() const;
71  ILabelStyleBindingRepository& GetLabelStyleBindingRepository() const;
72  ILabelPicker& GetLabelPicker() const;
73 
74  DEPRECATED("Replaced by GetQueryableLabelLayerFilterModel")
75  const ILabelFilterModel& GetLabelLayerFilterModel() const;
76  DEPRECATED("Replaced by GetModifiableLabelLayerFilterModel")
77  ILabelFilterModel& GetDebugLabelLayerFilterModel() const;
78 
79  void SynchronousLoad();
80 
81  private:
82  void OnStyleSheetLoadCompleted(const LabelStyleSheetLoaderResult& result);
83  void OnCategoryIconMapLoadCompleted(const Io::JsonFileLoaderResult& result);
84 
85  void PopulateDefaultAnchorCategories();
86 
87  void LoadStyleSheet(const std::string& styleSheetUrl);
88  void LoadCategoryIconMap(const std::string& categoryIconMapPath);
89 
90  LabelsModule(IAnchoredLabelSourceRepository* pLabelSourceRepository,
91  ILabelAnchorChangedEvent* pLabelAnchorChangedEvent,
92  ILabelCellResourceObserver* pLabelCellResourceObserver,
93  LabelCellModelController* pLabelCellModelController,
94  ILabelStyleSheetParser* pLabelStyleSheetParser,
95  ILabelTextStyleFactory* pLabelTextStyleFactory,
96  ILabelTextStyleRepository* pLabelTextStyleRepository,
97  ILabelIconStyleFactory* pLabelIconStyleFactory,
98  ILabelIconStyleRepository* pLabelIconStyleRepository,
99  ILabelStyleFactory* pLabelStyleFactory,
100  ILabelStyleRepository* pLabelStyleRepository,
101  ILabelStyleRepositoryObserver* pLabelStyleRepositoryObserver,
102  ILabelLayerFactory* pLabelLayerFactory,
103  ILabelLayerIdGenerator* pLabelLayerIdGenerator,
104  ILabelLayerRepository* pLabelLayerRepository,
105  ILabelLayerService* pLabelLayerService,
106  ILabelAnchorCategoryRepository* pLabelAnchorCategoryRepository,
107  ILabelStyleBindingRepository* pLabelStyleBindingRepository,
108  ILabelFontBindingService* pLabelFontBindingService,
109  ILabelResourceFontBindingRepository* pLabelResourceFontBindingRepository,
110  ILabelStyleSheetBuilder* pLabelStyleSheetBuilder,
111  ILabelStyleSheetLoader* pLabelStyleSheetLoader,
112  ILabelViewFactory* pLabelViewFactory,
113  ILabelViewRepository* pLabelViewRepository,
114  LabelViewRepositoryObserver* pLabelViewRepositoryObserver,
115  ILabelSourceRepositoryObserver* pLabelSourceRepositoryObserver,
116  ILabelModelSourceObserver* pLabelModelSourceObserver,
117  ILabelModelSourceFactory* pLabelModelSourceFactory,
118  ILabelModelFactory* pLabelModelFactory,
119  LabelSourceController* pLabelSourceController,
120  IOcclusionResolver* pOcclusionResolver,
121  ILabelController* pLabelController,
122  ILabelRenderer* pLabelRenderer,
123  LabelOptionsModel* pLabelOptionsModel,
124  LabelFilterModel* pInternallyModifiableLabelLayerFilterModel,
125  LabelFilterModel* pExternallyModifiableLabelLayerFilterModel,
126  LabelLayerFilterGroupModel* pLabelLayerFilterGroupModel,
127  LabelLayerFilterController* pLabelLayerFilterController,
128  LabelAnchorFilterModel* pPlatformLabelHiddenFilterModel,
129  LabelAnchorFilterModel* pLabelHiddenFilterModel,
130  ILabelPicker* pLabelPicker,
131  IUpdatable& loaderUpdatable,
132  ILabelAnchorCategoryIconMapRepository* pLabelAnchorCategoryIconMapRepository,
133  LabelAnchorCategoryIconMapLoader::TParsedResultsCallbacks* pLabelAnchorCategoryIconMapParsedResultsCallbacks,
134  LabelAnchorCategoryIconMapParser* pLabelAnchorCategoryIconMapParser,
135  LabelAnchorCategoryIconMapLoader* pLabelAnchorCategoryIconMapLoader,
136  ILabelAnchorCategoryIconMapper* pAsyncLoadedLabelAnchorCategoryIconMapper);
137 
138  IAnchoredLabelSourceRepository* m_pLabelSourceRepository;
139  ILabelAnchorChangedEvent* m_pLabelAnchorChangedEvent;
140  ILabelCellResourceObserver* m_pLabelCellResourceObserver;
141  LabelCellModelController* m_pLabelCellModelController;
142  ILabelStyleSheetParser* m_pLabelStyleSheetParser;
143  ILabelTextStyleFactory* m_pLabelTextStyleFactory;
144  ILabelTextStyleRepository* m_pLabelTextStyleRepository;
145  ILabelIconStyleFactory* m_pLabelIconStyleFactory;
146  ILabelIconStyleRepository* m_pLabelIconStyleRepository;
147  ILabelStyleFactory* m_pLabelStyleFactory;
148  ILabelStyleRepository* m_pLabelStyleRepository;
149  ILabelStyleRepositoryObserver* m_pLabelStyleRepositoryObserver;
150  ILabelLayerFactory* m_pLabelLayerFactory;
151  ILabelLayerIdGenerator* m_pLabelLayerIdGenerator;
152  ILabelLayerRepository* m_pLabelLayerRepository;
153  ILabelLayerService* m_pLabelLayerService;
154  ILabelAnchorCategoryRepository* m_pLabelAnchorCategoryRepository;
155  ILabelFontBindingService* m_pLabelFontBindingService;
156  ILabelResourceFontBindingRepository* m_pLabelResourceFontBindingRepository;
157  ILabelStyleBindingRepository* m_pLabelStyleBindingRepository;
158  ILabelStyleSheetBuilder* m_pLabelStyleSheetBuilder;
159  ILabelStyleSheetLoader* m_pLabelStyleSheetLoader;
160  ILabelViewFactory* m_pLabelViewFactory;
161  ILabelViewRepository* m_pLabelViewRepository;
162  LabelViewRepositoryObserver* m_pLabelViewRepositoryObserver;
163  ILabelSourceRepositoryObserver* m_pLabelSourceRepositoryObserver;
164  ILabelModelSourceObserver* m_pLabelModelSourceObserver;
165  ILabelModelSourceFactory* m_pLabelModelSourceFactory;
166  ILabelModelFactory* m_pLabelModelFactory;
167  LabelSourceController* m_pLabelSourceController;
168  IOcclusionResolver* m_pOcclusionResolver;
169  ILabelController* m_pLabelController;
170  ILabelRenderer* m_pLabelRenderer;
171  LabelOptionsModel* m_pLabelOptionsModel;
172  LabelFilterModel* m_pInternallyModifiableLabelLayerFilterModel;
173  LabelFilterModel* m_pExternallyModifiableLabelLayerFilterModel;
174  LabelLayerFilterGroupModel* m_pLabelLayerFilterGroupModel;
175  LabelLayerFilterController* m_pLabelLayerFilterController;
176  LabelAnchorFilterModel* m_pPlatformLabelHiddenFilterModel;
177  LabelAnchorFilterModel* m_pLabelHiddenFilterModel;
178  ILabelPicker* m_pLabelPicker;
179  IUpdatable& m_loaderUpdatable;
180 
181  LabelAnchorCategoryIconMapLoader::TParsedResultsCallbacks* m_pLabelAnchorCategoryIconMapParsedResultsCallbacks;
182  ILabelAnchorCategoryIconMapRepository* m_pLabelAnchorCategoryIconMapRepository;
183  LabelAnchorCategoryIconMapParser* m_pLabelAnchorCategoryIconMapParser;
184  LabelAnchorCategoryIconMapLoader* m_pLabelAnchorCategoryIconMapLoader;
185  ILabelAnchorCategoryIconMapper* m_pLabelAnchorCategoryIconMapper;
186 
187  bool m_styleSheetLoadPending;
188  bool m_categoryIconMapLoadPending;
189  bool m_styleSheetLoaded;
190  bool m_categoryIconMapLoaded;
191 
193  Helpers::TCallback1<LabelsModule, const Io::JsonFileLoaderResult> m_categoryIconMapLoadCompleteCallback;
194 
195  void ClearRepositories();
196 
197  };
198  }
199 }