All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
DebugLabelsController.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 #include "ICallback.h"
6 #include "CallbackCollection.h"
7 #include "Fonts.h"
8 #include "Text.h"
9 #include "Labels.h"
10 #include "ILabelOptionsModel.h"
11 #include "Config.h"
12 #include "Markers.h"
13 
14 #include <string>
15 #include <map>
16 #include <vector>
17 
18 namespace Eegeo
19 {
20  namespace Debug
21  {
22  namespace Labels
23  {
25  {
26  public:
27  static DebugLabelsController* Create(Eegeo::Labels::LabelsModule& labelsModule,
28  Eegeo::Markers::MarkersModule& markersModule,
29  const Eegeo::Config::PlatformConfig& platformConfig);
30 
32  Eegeo::Labels::ILabelOptionsModelObserver& labelOptionsModelObserver,
33  const Eegeo::Labels::ILabelStyleRepository& labelStyleRepository,
34  Eegeo::Labels::ILabelStyleRepositoryObserver& labelStyleRepositoryObserver,
35  const std::vector<std::string>& fontNames,
36  bool platformConfigLabelsEnabled,
37  Eegeo::Markers::IMarkerService& markerService
38  );
39 
41 
42  void Update(float dt);
43 
44  void Next();
45  void Prev();
46  void ToggleIdentifyStyle();
47  void LabelConstraintRadiusScaleUp();
48  void LabelConstraintRadiusScaleDown();
49  void LabelFadeDurationUp();
50  void LabelFadeDurationDown();
51  void LabelCycleOcclusionMode();
52  void LabelCycleFont();
53  void LabelToggleDebugDraw();
54  void LabelToggleEnabled();
55  void LabelRestartApp();
56  void ToggleTestMarkers();
57 
58  std::string GetCurrentStyleName() const;
59 
60  bool IsIdentifyStyleEnabled() const;
61  float GetLabelAATweak() const;
62  float GetConstraintRadiusScale() const;
63  float GetFadeDurationScale() const;
64  bool IsDebugDrawEnabled() const;
65  bool IsLabelsEnabled() const;
66  bool IsRestartRequired() const;
67  bool IsTestMarkersEnabled() const;
68  std::string GetFontName() const;
69 
70  Eegeo::Labels::OcclusionResolverMode::Type GetOcclusionMode() const;
71 
72  void RegisterViewModelChangedCallback(Helpers::ICallback0& callback);
73  void UnRegisterViewModelChangedCallback(Helpers::ICallback0& callback);
74 
75  private:
76  void OnLabelOptionsModelChanged();
77  void OnLabelStyleRepositoryChanged();
78 
79  void RefreshLabelStyleNames();
80 
81  void CreateTestMarkers();
82  void DestroyTestMarkers();
83  void UpdateMovingMarker(float dt);
84 
85  const Eegeo::Labels::LabelStyle& GetCurrentStyle() const;
86  void SetAATweak(float antiAliasTweak);
87 
88  Eegeo::Labels::ILabelOptionsModel& m_labelOptionsModel;
89  Eegeo::Labels::ILabelOptionsModelObserver& m_labelOptionsModelObserver;
90 
91  const Eegeo::Labels::ILabelStyleRepository& m_labelStyleRepository;
92  Eegeo::Labels::ILabelStyleRepositoryObserver& m_labelStyleRepositoryObserver;
93  const std::vector<std::string> m_fontNames;
94  const bool m_platformConfigLabelsEnabled;
95  Eegeo::Markers::IMarkerService& m_markerService;
96 
97 
98  bool m_labelsEnabled;
99 
100  bool m_restartRequired;
101  bool m_fontChanged;
102  bool m_testMarkersCreated;
103 
104  int m_currentIndex;
105 
106  int m_movingMarkerId;
107  float m_movingMarkerTimer;
108  int m_movingMarkerCounter;
109 
110  int m_indoorMarkerId;
111 
112 
113  Helpers::CallbackCollection0 m_viewModelChangedChangedCallbacks;
114 
115  Helpers::TCallback0<DebugLabelsController> m_labelOptionsModelChangedCallback;
116  Helpers::TCallback0<DebugLabelsController> m_labelStyleRepositoryChangedCallback;
117 
118  std::vector<std::string> m_labelStyleNames;
119  std::vector<int> m_testMarkerIds;
120 
121  float m_antiAliasTweak;
122 
123  void NotifyViewModelChanged();
124  };
125  }
126  }
127 }