All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
InteriorSelectionModel.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 #include "Types.h"
6 #include "Interiors.h"
7 #include "CallbackCollection.h"
8 #include "ICallback.h"
9 #include "InteriorId.h"
10 
11 #include <string>
12 
13 namespace Eegeo
14 {
15  namespace Resources
16  {
17  namespace Interiors
18  {
19  namespace InteriorSelectionReason
20  {
21  enum Type
22  {
23  None,
24  EntryMarkerInteraction,
25  ApiCall
26  };
27  }
29  {
30  public:
31 
33 
34  virtual ~InteriorSelectionModel();
35 
36  virtual bool IsInteriorSelected() const;
37 
38  virtual InteriorId GetSelectedInteriorId() const;
39 
40  virtual bool IsUseDefaultInitialFloor() const { return m_useDefaultInitialFloor; }
41 
42  virtual int GetInitialIndoorMapFloorId() const { return m_initialIndoorMapFloorId; }
43 
45  virtual void SelectInteriorId(const InteriorId& interiorId);
46 
47  virtual void SetIndoorMapSelectionFromEntryMarkerInteraction(const InteriorId& indoorMapId);
48 
49  virtual void SetIndoorMapSelection(const InteriorId& indoorMapId);
50 
51  virtual void SetIndoorMapSelectionWithFloor(const InteriorId& indoorMapId, int initialIndoorMapFloorId);
52 
53  virtual void ClearSelection();
54 
55  virtual void SelectionFailed();
56 
57  virtual InteriorSelectionReason::Type GetInteriorSelectionReason() const { return m_interiorSelectionReason; }
58 
59  virtual void SetClearSelectionWhenNotInSceneGraph(bool clearSelectIfNotInSceneGraph);
60 
61  virtual bool ShouldClearSelectionWhenNotInSceneGraph() const { return m_clearSelectionIfNotInSceneGraph; }
62 
63  virtual void RegisterSelectionChangedCallback(Helpers::ICallback1<const InteriorId>& callback);
64 
65  virtual void RegisterSelectionFailedCallback(Helpers::ICallback1<const InteriorId>& callback);
66 
67  virtual void UnregisterSelectionChangedCallback(Helpers::ICallback1<const InteriorId>& callback);
68 
69  virtual void UnregisterSelectionFailedCallback(Helpers::ICallback1<const InteriorId>& callback);
70  private:
71  void SetIndoorMapSelection(
72  const InteriorId& indoorMapId,
73  bool useDefaultInitialFloor,
74  int initialIndoorMapFloorId,
75  InteriorSelectionReason::Type interiorSelectionReason
76  );
77 
78  InteriorId m_selectedInteriorId;
79  bool m_useDefaultInitialFloor;
80  int m_initialIndoorMapFloorId;
81  InteriorSelectionReason::Type m_interiorSelectionReason;
82  bool m_clearSelectionIfNotInSceneGraph;
83 
84  Helpers::CallbackCollection1<const InteriorId> m_selectionChangedObservers;
85  Helpers::CallbackCollection1<const InteriorId> m_selectionFailedObservers;
86  };
87  }
88  }
89 }