All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
LabelStyle.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 #include "Types.h"
6 #include "Labels.h"
7 #include "Text.h"
8 #include "Fonts.h"
9 #include "VectorMath.h"
10 
11 #include <string>
12 
13 namespace Eegeo
14 {
15  namespace Labels
16  {
17  namespace LabelOrientation
18  {
19  enum Type
20  {
21  Screen,
22  MapFeature,
23  MapFeatureAutoUpright
24  };
25  }
26 
27  namespace LabelDisplay
28  {
29  enum Type
30  {
31  ScreenSpace,
32  WorldSpaceUpright
33  };
34  }
35 
36  namespace LabelHorizontalAlignment
37  {
38  enum Type
39  {
40  LeadingGlyph,
41  Left,
42  Center,
43  Right
44  };
45  }
46 
47  namespace LabelVerticalAlignment
48  {
49  enum Type
50  {
51  Baseline,
52  Bottom,
53  Middle,
54  Top
55  };
56  }
57 
58  namespace StencilMode
59  {
60  enum Type
61  {
62  Always,
63  IfNotMaskedByMapFeature,
64  IfMaskedByMapFeature,
65  WithMaskedStyle
66  };
67  }
68 
69  namespace ScreenMarginHiding
70  {
71  enum Type
72  {
73  Never,
74  IfLabelOutsideMargin,
75  IfIconOutsideMargin
76  };
77  }
78 
80  {
81  public:
82  typedef std::string IdType;
83 
84  LabelStyle(const IdType& labelStyleId,
85  const LabelTextStyle* pLabelTextStyle,
86  const LabelIconStyle* pLabelIconStyle,
87  LabelOrientation::Type labelOrientation,
88  LabelDisplay::Type labelDisplay,
89  LabelHorizontalAlignment::Type labelHorizontalAlignment,
90  LabelVerticalAlignment::Type labelVerticalAlignment,
91  const v2& labelOffsetEms,
92  float labelAltitudeOffset,
93  float constraintRadiusScale,
94  float fadeDuration,
95  bool initiallyFadedOut,
96  bool pickable,
97  StencilMode::Type stencilMode,
98  StencilMode::Type stencilModeFlattened,
99  int priority,
100  float screenMargin,
101  ScreenMarginHiding::Type screenMarginHiding,
102  bool ignoreOcclusion,
103  const v2& iconOffset,
104  const int styleIndex
105  );
106 
107  IdType GetId() const { return m_id; }
108 
109  const LabelTextStyle* GetTextStyle() const { return m_pLabelTextStyle; }
110 
111  const LabelIconStyle* GetIconStyle() const { return m_pLabelIconStyle; }
112 
113  LabelOrientation::Type GetLabelOrientation() const { return m_labelOrientation; }
114 
115  LabelDisplay::Type GetLabelDisplay() const { return m_labelDisplay; }
116 
117  LabelHorizontalAlignment::Type GetLabelHorizontalAlignment() const { return m_labelHorizontalAlignment; }
118 
119  LabelVerticalAlignment::Type GetLabelVerticalAlignment() const { return m_labelVerticalAlignment; }
120 
121  const v2& GetLabelOffsetEms() const { return m_labelOffsetEms; }
122 
123  float GetLabelAltitudeOffset() const { return m_labelAltitudeOffset; }
124 
125  float GetConstraintRadiusScale() const { return m_constraintRadiusScale; }
126 
127  float GetFadeDuration() const { return m_fadeDuration; }
128 
129  bool ShouldFade() const { return m_fadeDuration > 0.f; }
130 
131  float GetFadeSpeed() const { return m_fadeSpeed; }
132 
133  bool IsInitiallyFadedOut() const { return m_initiallyFadedOut; }
134 
135  int GetPriority() const { return m_priority; }
136 
137  bool IsPickable() const { return m_pickable; }
138 
139  StencilMode::Type GetStencilMode() const { return m_stencilMode; }
140 
141  StencilMode::Type GetStencilModeFlattened() const { return m_stencilModeFlattened; }
142 
143  float GetScreenMargin() const { return m_screenMargin; }
144 
145  ScreenMarginHiding::Type GetScreenMarginHiding() const { return m_screenMarginHiding; }
146 
147  bool WillIgnoreOcclusion() const { return m_ignoreOcclusion; }
148 
149  const v2& GetIconOffset() const { return m_iconOffset; }
150 
151  const int GetStyleIndex() const { return m_styleIndex; }
152  private:
153  const IdType m_id;
154  const LabelTextStyle* m_pLabelTextStyle;
155  const LabelIconStyle* m_pLabelIconStyle;
156  const LabelOrientation::Type m_labelOrientation;
157  const LabelDisplay::Type m_labelDisplay;
158  const LabelHorizontalAlignment::Type m_labelHorizontalAlignment;
159  const LabelVerticalAlignment::Type m_labelVerticalAlignment;
160  const v2 m_labelOffsetEms;
161  const float m_labelAltitudeOffset;
162  const float m_constraintRadiusScale;
163  const float m_fadeDuration;
164  const float m_fadeSpeed;
165  const StencilMode::Type m_stencilMode;
166  const StencilMode::Type m_stencilModeFlattened;
167  const bool m_initiallyFadedOut;
168  const bool m_pickable;
169  const int m_priority;
170  const float m_screenMargin;
171  const ScreenMarginHiding::Type m_screenMarginHiding;
172  const bool m_ignoreOcclusion;
173  const v2 m_iconOffset;
174  const int m_styleIndex;
175  };
176  }
177 }