All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
InteriorInteractionModel.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 #include "Interiors.h"
6 #include "Types.h"
7 #include "ICallback.h"
8 #include "CallbackCollection.h"
9 #include "VectorMath.h"
10 
11 #include <string>
12 
13 namespace Eegeo
14 {
15  namespace Resources
16  {
17  namespace Interiors
18  {
20  {
21  public:
23 
24  bool HasInteriorModel() const { return m_pInteriorModel != NULL; }
25  const InteriorsModel* GetInteriorModel() const { return m_pInteriorModel; }
26  void SetInteriorModel(const InteriorsModel& interiorModel);
27  void SetInteriorModelAtFloorIndex(const InteriorsModel& interiorModel, int floorIndex);
28  void ClearInteriorModel();
29  const InteriorsFloorModel* GetSelectedFloorModel() const;
30 
31  bool IsFullyExpanded() const { return m_expandedState == Expanded; }
32  bool IsCollapsed() const { return m_expandedState == Collapsed; }
33  bool IsEnteringExpanded() const { return m_expandedState == EnteringExpanded; }
34  bool IsExitingExpanded() const { return m_expandedState == ExitingExpanded; }
35 
36  bool CanExpand() const;
37 
38  void ToggleExpanded();
39  void FinishEnterExpanded();
40  void FinishExitExpanded();
41  void SetFullyExpanded();
42  void SetCollapsed();
43 
44  void SetExpandedParam(float expandedParam);
45  float GetExpandedParam() const { return m_expandedParam; }
46 
47  float GetFloorParam() const { return m_floorParam; }
48  void SetFloorParam(float floorParam);
49 
50  int GetSelectedFloorIndex() const { return m_selectedFloorIndex; }
51  void SetSelectedFloorIndex(int floorIndex);
52 
53  v4 GetBackgroundColor() const { return m_backgroundColor; }
54  void SetBackgroundColor(const v4& color);
55 
56  void RegisterInteractionStateChangedCallback(Helpers::ICallback0& callback);
57  void UnregisterInteractionStateChangedCallback(Helpers::ICallback0& callback);
58 
59  void RegisterModelChangedCallback(Helpers::ICallback0& callback);
60  void UnregisterModelChangedCallback(Helpers::ICallback0& callback);
61 
62  void RegisterSelectedFloorChangedCallback(Helpers::ICallback0& callback);
63  void UnregisterSelectedFloorChangedCallback(Helpers::ICallback0& callback);
64 
65  void RegisterBackgroundColorChangedCallback(Helpers::ICallback0& callback);
66  void UnregisterBackgroundColorChangedCallback(Helpers::ICallback0& callback);
67 
68  private:
69 
70  enum ExpandedState
71  {
72  Collapsed,
73  EnteringExpanded,
74  Expanded,
75  ExitingExpanded
76  };
77 
78  ExpandedState m_expandedState;
79 
80  float m_expandedParam;
81  float m_floorParam;
82  int m_selectedFloorIndex;
83  v4 m_backgroundColor;
84 
85  const InteriorsModel* m_pInteriorModel;
86 
87  Helpers::CallbackCollection0 m_interactionStateChangedCallbacks;
88  Helpers::CallbackCollection0 m_modelChangedCallbacks;
89  Helpers::CallbackCollection0 m_selectedFloorChangedCallbacks;
90  Helpers::CallbackCollection0 m_backgroundColorChangedCallbacks;
91 
92  };
93  }
94  }
95 }