All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
CityThemesUpdater.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 #include "ICityThemesUpdater.h"
6 #include "CityThemes.h"
7 #include "Types.h"
8 #include "Camera.h"
9 #include "VectorMath.h"
10 #include <string>
11 #include "ConfigSections.h"
12 
13 namespace Eegeo
14 {
15  namespace Resources
16  {
17  namespace CityThemes
18  {
19 
21  {
22  public:
23  CityThemesUpdater(const CityThemeRepository& repository,
24  ICityThemesService& themeService,
25  CityThemesMissingDataHandler& cityThemesMissingDataHandler,
26  float cameraLocationDeltaThreshold,
27  float maxAltitudeForUpdate,
28  const Config::CityThemesConfigSection& cityThemesConfig);
29 
30  void Update(float deltaSeconds, const dv3& cameraEcefPosition);
31  bool GetEnabled() const { return m_enabled; }
32  void SetEnabled(bool enabled) { m_enabled = enabled; }
33 
34  void SetThemeMustContain(const std::string& themeMustContain);
35  void TryRefreshTheme();
36 
37  private:
38  const CityThemeRepository& m_cityThemeRepository;
39  ICityThemesService& m_themeService;
40  CityThemesMissingDataHandler& m_cityThemesMissingDataHandler;
41 
42  const float m_cameraLocationDeltaThreshold;
43  const float m_maxAltitudeForUpdate;
44 
45  void TryChangeTheme(const dv3& cameraEcefLocation);
46 
47  Eegeo::dv3 m_locationLastUpdate;
48  bool m_enabled;
49  bool m_shouldTryChangeTheme;
50 
51  std::string m_themeMustContain;
52 
53  std::string m_globeViewStateName;
54  float m_globeViewAltitude;
55  bool m_atAltitude;
56  };
57 
58  }
59  }
60 }