All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
ShapeModelBase.h
1 #pragma once
2 
3 #include "Types.h"
4 #include "IShapeModel.h"
5 #include "Positioning.h"
6 #include "ICallback.h"
7 #include "VectorMath.h"
8 #include "Space.h"
9 #include "InteriorId.h"
10 
11 #include <vector>
12 
13 
14 namespace Eegeo
15 {
16  namespace Shapes
17  {
18 
20  {
21  public:
22  typedef std::vector<Eegeo::Positioning::IPointOnMap*> PointOnMapVector;
23 
24  ShapeModelBase(IdType shapeModelId,
25  const Resources::Interiors::InteriorId& indoorMapId,
26  int indoorMapFloorId,
27  const dv3& originEcef,
28  const PointOnMapVector& points,
29  const std::vector<double>& perPointElevations,
30  double elevation,
31  const std::vector<u16>& geometryIndices,
32  const Space::LatLong& boundsSouthWest,
33  const Space::LatLong& boundsNorthEast
34  );
35 
36  virtual ~ShapeModelBase();
37 
38  virtual IdType GetId() const { return m_id; }
39 
40  virtual bool IsIndoor() const;
41 
42  virtual const Resources::Interiors::InteriorId& GetIndoorMapId() const;
43 
44  virtual int GetIndoorMapFloorIndex() const;
45 
46  virtual void SetIndoorMapId(const Resources::Interiors::InteriorId& indoorMapId);
47 
48  virtual void SetIndoorMapFloorId(int indoorMapFloorId);
49 
50  virtual void SetElevation(double elevation);
51 
52  virtual void SetElevationMode(Eegeo::Positioning::ElevationMode::Type elevationMode);
53 
54  virtual dv3 GetOriginEcef() const;
55 
56  virtual std::vector<v3> GetVertices() const;
57 
58  virtual std::vector<u16> GetGeometryIndices() const;
59 
60  virtual void GetBounds(Space::LatLong& out_southWest, Space::LatLong& out_northEast) const;
61 
62  protected:
63  virtual void NotifyPointOnMapChanged() = 0;
64 
65  private:
66  Eegeo::Positioning::IPointOnMap& GetPointOnMap() const;
67  void RegisterPointOnMapChangedEvents();
68  void UnregisterPointOnMapChangedEvents();
69  void OnPointOnMapChanged();
70  void OnPositioningViewComponentChanged();
71 
72  const IdType m_id;
73 
75  int m_indoorMapFloorId;
76  const PointOnMapVector m_points;
77  const std::vector<double> m_perPointElevations;
78  double m_elevation;
79  const std::vector<u16> m_geometryIndices;
80  const dv3 m_originEcef;
81 
82  Space::LatLong const m_boundsSouthWest;
83  Space::LatLong const m_boundsNorthEast;
84 
85  Helpers::TCallback0<ShapeModelBase> m_pointOnMapChanged;
86  };
87  }
88 }