All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
InteriorsFloorCell.h
1 // Copyright eeGeo Ltd (2012-2015), All Rights Reserved
2 
3 #pragma once
4 
5 #include "Types.h"
6 #include "Rendering.h"
7 #include "Interiors.h"
8 #include "InteriorsMaterials.h"
9 #include "MortonKey.h"
10 #include "VectorMath.h"
11 #include "InteriorRenderableSet.h"
12 #include "Labels.h"
13 #include "InteriorsFloorCellFeature.h"
14 
15 #include <vector>
16 #include <string>
17 #include <map>
18 
19 namespace Eegeo
20 {
21  namespace Resources
22  {
23  namespace Interiors
24  {
26  {
27  public:
28  static const std::string DefaultTag;
29  static const std::string DefaultDetailTag;
30 
31  typedef std::map<std::string, InteriorRenderableSet*> TagToRenderableSetType;
32 
33  InteriorsFloorCell(const std::string& interiorName,
34  const Streaming::MortonKey& cellKey,
35  TagToRenderableSetType* pTagToRenderableSet,
36  const std::vector<Rendering::Renderables::InteriorHighlightRenderable*>& interiorHighlightRenderables,
37  const std::vector<Entities::InteriorsEntityModel*>& entityModels,
38  const std::vector<Entities::InteriorsEntityGeometryView*>& entityGeometryViews,
39  const Labels::LabelCellModel* pLabelCellModel,
40  Labels::TransformedLabelCellModel* pTransformedLabelCellModel,
41  const int floorNumber,
42  InteriorsFloorCellFeatureContainer* pInteriorsFloorCellFeatureContainer,
44  const InteriorsFloorCellEntityPolygonContainer* interiorsFloorCellEntityPolygonContainer);
45 
47 
48  const Streaming::MortonKey& GetCellKey() const { return m_cellKey; }
49 
50  const std::string& GetInteriorId() const { return m_interiorName; }
51 
52  const dv3& GetCellOrigin() const { return m_cellCentreEcef; }
53 
54  bool ContainsRenderableSetForTag(const std::string& tag) const;
55 
56  InteriorRenderableSet& GetRenderableSetForTag(const std::string& tag) const;
57 
58  bool TryActivateTag(const std::string& tag) const;
59 
60  bool TryDeactivateTag(const std::string& tag) const;
61 
62  bool TryGetTagIsActive(const std::string& tag, bool &isActive) const;
63 
64  std::vector<Rendering::Renderables::InteriorFloorRenderable*> GetActiveFloorFeatureRenderables() const;
65 
66  std::vector<InteriorsStencilMirrorClearRenderable*> GetActiveStencilMirrorClearRenderables() const;
67 
68  std::vector<Rendering::Renderables::InstancedInteriorFloorRenderable*> GetActiveInstancedRenderables() const;
69 
70  std::vector<Rendering::Renderables::InstancedInteriorFloorRenderable*> GetInstancedRenderables() const;
71 
72  std::vector<Rendering::Renderables::InteriorHighlightRenderable*> GetHighlightRenderables() const;
73 
74  const std::vector<Entities::InteriorsEntityModel*>& GetEntityModels() const { return m_entityModels; }
75 
76  std::vector<Entities::InteriorsEntityGeometryView*> GetGeometryViews() const { return m_entityGeometryViews; }
77 
78  int GetFloorNumber() const { return m_floorNumber; }
79 
80  const InteriorsFloorCellFeatureContainer& GetInteriorsFloorCellFeatureContainer() const { return *m_pInteriorsFloorCellFeatureContainer; }
81 
82  const Labels::LabelCellModel& GetLabelCellModel() const { return *m_pLabelCellModel; }
83 
84  Labels::TransformedLabelCellModel& GetTransformedLabelCellModel() const { return *m_pTransformedLabelCellModel; }
85 
86  const InteriorsFloorCellEntityPolygonContainer& GetEntityPolygonContainer() const { return *m_pEntityPolygonContainer; }
87 
88  void UpdateFloorRenderables(const v4& defaultColor, const v4& detailColor, float saturation, const m44& modelTransform, const m44& normalTransform) const;
89 
90  void UpdateEntityRenderables(const v4& color, float saturation, const m44& modelTransform, const m44& normalTransform) const;
91 
92  void UpdateHighlightRenderables(const v4& floorColor, const m44& modelTransform, const m44& normalTransform) const;
93 
94  private:
95 
96  std::string m_interiorName;
97  const Streaming::MortonKey m_cellKey;
98  const dv3 m_cellCentreEcef;
99  const std::vector<Entities::InteriorsEntityModel*> m_entityModels;
100  const std::vector<Entities::InteriorsEntityGeometryView*> m_entityGeometryViews;
101  TagToRenderableSetType* m_pTagToRenderableSet;
102  std::vector<Rendering::Renderables::InteriorHighlightRenderable*> m_interiorHighlightRenderables;
103  const Labels::LabelCellModel* m_pLabelCellModel;
104  Labels::TransformedLabelCellModel* m_pTransformedLabelCellModel;
105  const int m_floorNumber;
106  InteriorsFloorCellFeatureContainer* m_pInteriorsFloorCellFeatureContainer;
108  const InteriorsFloorCellEntityPolygonContainer* m_pEntityPolygonContainer;
109  };
110  }
111  }
112 }