All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
LabelModel.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 #include "IAnchoredLabel.h"
6 #include "Types.h"
7 #include "Labels.h"
8 #include "ShapedText.h"
9 #include "IconDefinition.h"
10 #include "Bounds.h"
11 #include "VectorMath.h"
12 
13 #include <string>
14 
15 namespace Eegeo
16 {
17  namespace Labels
18  {
20  {
21  public:
22 
23  LabelModel(const IdType& anchoredLabelId,
24  const LabelAnchorCategory& labelAnchorCategory,
25  const Labels::LabelStyle& labelStyle,
26  const dv3& ecefAnchorPosition,
27  const v3& localAnchorOffset,
28  float constraintRadiusEcef,
29  const Text::ShapedText& shapedText,
30  const Icons::IconDefinition* pIconDefinition,
31  const std::string& entityName,
32  int subPriority,
33  ILabelAnchorChangedEvent& labelAnchorChangedEvent);
34 
35  virtual ~LabelModel();
36 
37  virtual IdType GetId() const;
38 
39  virtual const std::string& GetEntityName() const;
40 
41  virtual const LabelAnchorCategory& GetLabelAnchorCategory() const;
42 
43  virtual void GetShapedGlyphs(std::vector<Text::ShapedGlyph>& out_shapedGlyphs) const;
44 
45  virtual const Icons::IconDefinition* GetIconDefinition() const;
46 
47  virtual dv3 GetEcefAnchorPosition() const;
48 
49  virtual v3 GetAnchorOffset() const;
50 
51  virtual m44 CalcFeatureAlignedAnchorBasisEcef(float environmentFlatteningScale) const;
52 
53  virtual Geometry::AxisAlignedBox2 GetLocalTextBounds() const;
54 
55  virtual float GetConstraintRadiusEcef() const;
56 
57  virtual bool CanCacheAnchorOffset() const;
58 
59  virtual int GetSubPriority() const;
60 
61  virtual void SetSubPriority(int subPriority);
62 
63  virtual void SetEcefAnchorPosition(const dv3& ecefAnchorPosition);
64 
65  virtual void SetTransform(const m44& transform);
66 
67  virtual void SetLabelText(const std::string& labelTextUtf8);
68 
69  virtual void SetIconKey(const std::string& iconKey);
70 
71  virtual void SetLocalAnchorOffset(const v3& localAnchorOffset);
72 
73 
74 
75  private:
76  void UpdateTransformedAnchorOffset();
77 
78  const IdType m_anchoredLabelId;
79  Text::ShapedText m_shapedText;
80  const std::string m_entityName;
81  dv3 m_ecefAnchorPosition;
82  v3 m_localAnchorOffset;
83  v3 m_transformedAnchorOffset;
84  const float m_constraintRadiusEcef;
85  const LabelAnchorCategory& m_labelAnchorCategory;
86  const Labels::LabelStyle& m_labelStyle;
87  const Icons::IconDefinition* m_pIconDefinition;
88  int m_subPriority;
89  ILabelAnchorChangedEvent& m_labelAnchorChangedEvent;
90  };
91 
92  }
93 }