All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
MarkerModel.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 #include "Markers.h"
6 #include "Types.h"
7 #include "IMarker.h"
8 #include "Labels.h"
9 #include "VectorMath.h"
10 #include "LatLongAltitude.h"
11 #include "ICallback.h"
12 #include "Positioning.h"
13 
14 
15 namespace Eegeo
16 {
17  namespace Markers
18  {
19  class MarkerModel : public IMarker, private Eegeo::NonCopyable
20  {
21  public:
22 
23  MarkerModel(IdType markerId,
24  Labels::LabelModel* pLabelModel,
25  Positioning::IPointOnMap* pPointOnMap,
26  const std::string& labelTextUtf8,
27  const std::string& iconKey,
28  float labelVerticalOffset,
29  bool isHidden,
30  const Positioning::IPositioningViewComponent& positioningViewComponent,
31  MarkerHiddenChangedEvent& markerHiddenChangedEvent);
32 
33  ~MarkerModel();
34 
35  virtual IdType GetId() const { return m_markerId; }
36 
37  virtual const std::string& GetEntityName() const;
38 
39  virtual bool IsIndoorMarker() const;
40 
41  virtual double GetElevation() const;
42 
43  virtual Positioning::ElevationMode::Type GetElevationMode() const;
44 
45  virtual Space::LatLongAltitude GetAnchorLocation() const;
46 
47  virtual void SetLocation(double latitudeDegrees, double longitudeDegrees);
48 
49  virtual void SetElevation(double elevation);
50 
51  virtual void SetElevationMode(Positioning::ElevationMode::Type elevationMode);
52 
53  virtual bool ShouldHideLabel() const;
54 
55  virtual Labels::IAnchoredLabel& GetLabelModel() const;
56 
57  virtual void SetHidden(bool isHidden);
58 
59  virtual bool IsHidden() const;
60 
61  virtual void SetSubPriority(int subPriority);
62 
63  virtual void SetInteriorFloor(int interiorFloorNumber);
64 
65  virtual void SetLabelText(const std::string& labelTextUtf8);
66 
67  virtual void SetIconKey(const std::string& iconKey);
68 
69  virtual void SetLabelVerticalOffset(float verticalOffset);
70 
71 
72  private:
73  void UpdateLabelAnchorPositionEcef();
74 
75  void UpdateLabelTransform();
76 
77  void OnPointOnMapChanged();
78 
79  void OnPositioningViewComponentChanged();
80 
81  Helpers::TCallback0<MarkerModel> m_pointOnMapChanged;
82  Helpers::TCallback0<MarkerModel> m_positioningViewComponentChangedHandler;
83 
84  IdType m_markerId;
85  Labels::LabelModel* m_pLabelModel;
86  Positioning::IPointOnMap* m_pPointOnMap;
87  float m_labelVerticalOffset;
88  std::string m_labelTextUtf8;
89  std::string m_iconKey;
90 
91  const Positioning::IPositioningViewComponent& m_positioningViewComponent;
92  MarkerHiddenChangedEvent& m_markerHiddenChangedEvent;
93  bool m_isHidden;
94  };
95  }
96 }