All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
PropController.h
1 #pragma once
2 
3 #include "IInteriorEntitiesWebService.h"
4 #include "Positioning.h"
5 #include "Interiors.h"
6 #include "InteriorId.h"
7 #include "VectorMath.h"
8 #include "IProp.h"
9 #include "IPropController.h"
10 #include <unordered_map>
11 #include <vector>
12 #include <unordered_set>
13 
14 
15 namespace Eegeo
16 {
17  namespace Resources
18  {
19  namespace Interiors
20  {
22  {
23  InteriorId m_interiorId;
24  int m_floorId;
25  dv3 m_originEcef;
26  };
27 
29  {
30  public:
31 
33  IPropService& propService,
34  InteriorInteractionModel& interiorInteractionModel,
35  Webservice::IInteriorEntitiesWebService& interiorEntitiesWebService,
36  PropResourceRepository& propResourceRepository);
37 
38  ~PropController();
39 
40  const InteriorEntitySetPropIds& GetCurrentProps() override;
41 
42  void RegisterIndoorMapPropsLoaded(Helpers::ICallback2<const InteriorId, const int>& callback) override;
43  void UnregisterIndoorMapPropsLoaded(Helpers::ICallback2<const InteriorId, const int>& callback) override;
44 
45  private:
46 
47  IPropService& m_propService;
48  InteriorInteractionModel& m_interiorInteractionModel;
49  Webservice::IInteriorEntitiesWebService& m_interiorEntitiesWebService;
50  PropResourceRepository& m_propResourceRepository;
51 
52  std::unordered_map<Webservice::InteriorEntitiesRequestId, PropRequestOrigin> m_entityRequestsToRequestOrigins;
53  InteriorEntitySetPropIds m_currentProps;
54  std::unordered_set<int> m_queriedFloorIds;
55  const InteriorsModel* m_lastQueriedInteriorModel;
56 
57  Helpers::CallbackCollection2<const InteriorId, const int> m_indoorMapPropsLoadedCallbacks;
58 
59  Helpers::TCallback0<PropController> m_interiorInteractionModelSelectedFloorChangedCallback;
60  Helpers::TCallback0<PropController> m_interiorInteractionModelChangedCallback;
62 
63  void ClearCurrentPropSet();
64 
65  void OnInteriorInteractionModelSelectedFloorChanged();
66 
67  void PopulateEntitiesForFloor(const int floorId);
68 
69  void RequestEntities(const InteriorId& interiorId, int floorId, const dv3& interiorOrigin);
70 
71  void OnInteriorInteractionModelChanged();
72 
73  void HandleLoadEntities(const Eegeo::Resources::Interiors::Webservice::InteriorEntitiesRequestResponse& response);
74  };
75  }
76  }
77 }