All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
HeatmapShapeView.h
1 #pragma once
2 
3 #include "HeatmapShapes.h"
4 #include "ShapeViewBase.h"
5 #include "Rendering.h"
6 #include "VectorMath.h"
7 #include "SingleSphere.h"
8 #include "Geometry.h"
9 #include "Space.h"
10 #include "AsyncTexturing.h"
11 
12 #include <vector>
13 #include <string>
14 
15 namespace Eegeo
16 {
17  namespace Shapes
18  {
19  namespace Heatmaps
20  {
22  {
23  public:
25  const HeatmapShapeModel& heatmapShapeModel,
26  bool isHidden,
27  const dv3& originEcef,
28  const std::vector<dv3>& boundingPointsEcef,
29  const Eegeo::Geometry::SingleSphere& boundingSphere,
30  const Rendering::VertexLayouts::VertexLayout& vertexLayout,
31  Rendering::GlBufferPool& glBufferPool,
32  const m44& worldToTextureTransform,
33  float parameterizationHalfExtentMeters,
34  float floatDecodeScale,
35  Rendering::Mesh* pMesh,
36  HeatmapShapeRenderable* pHeatmapShapeRenderable,
37  HeatmapShapeRenderable* pHeatmapShapeRenderableOccluded,
38  Rendering::AsyncTexturing::Texture* pGradientTexture,
39  const std::vector<Rendering::AsyncTexturing::Texture*>& intensityTextures,
40  const std::string& indoorMapId,
41  int indoorMapFloorIndex
42  );
43 
45 
46  void Update();
47 
48  void UpdateIntensityTextures(
49  const v2& textureDimensions,
50  const std::vector<Eegeo::Space::WeightedLatLongAltitude>& weightedPoints,
51  float weightMin,
52  float weightMax,
53  float intensityBias,
54  const std::vector<double>& heatmapRadiiMeters,
55  const std::vector<double>& heatmapGains,
56  bool useApproximation
57  );
58 
59  void UpdateGradientTexture(
60  const std::vector<float>& gradientStops,
61  const std::vector<v4>& gradientColors
62  );
63 
64  void UpdateGeometry(
65  const dv3& meshOriginEcef,
66  const std::vector<v3>& meshPoints,
67  const std::vector<u16>& meshTriListIndices
68  );
69 
70  void UpdateUniforms(
71  float opacity,
72  float intensityBias,
73  float intensityScale,
74  float occludedStyleAlpha,
75  float occludedStyleSaturation,
76  float occludedStyleBrightness,
77  u32 nonOccludedStencilMapLayerMask,
78  u32 occludedStencilMapLayerMask,
79  bool isIndoor
80  );
81 
82  void UpdateDensityBlend(
83  const std::vector<float>& heatmapDensityStops,
84  float densityBlend
85  );
86 
87  void UpdateIndoorMap(
88  const std::string& indoorMapId,
89  int indoorMapFloorIndex
90  );
91 
92  Rendering::RenderableBase& GetRenderable() const;
93 
94  void GetRenderables(std::vector<Rendering::RenderableBase*>& out_renderables) const;
95 
96  const std::string& GetIndoorMapId() const { return m_indoorMapId; }
97 
98  int GetIndoorMapFloorIndex() const { return m_indoorMapFloorIndex; }
99 
100  private:
101 
102  Rendering::Mesh* CreateMesh(
103  const dv3& meshOriginEcef,
104  const std::vector<v3>& meshPoints,
105  const std::vector<v2>& textureCoords,
106  const std::vector<u16>& meshTriListIndices
107  );
108 
109  const Rendering::VertexLayouts::VertexLayout& m_vertexLayout;
110  Rendering::GlBufferPool& m_glBufferPool;
111  const m44 m_worldToTextureTransform;
112  const float m_parameterizationHalfExtentMeters;
113  const float m_floatEncodeScale;
114  Rendering::Mesh* m_pMesh;
115  HeatmapShapeRenderable* const m_pHeatmapShapeRenderable;
116  HeatmapShapeRenderable* const m_pHeatmapShapeRenderableOccluded;
117  Rendering::AsyncTexturing::Texture* const m_pGradientTexture;
118  std::vector<Rendering::AsyncTexturing::Texture*> m_intensityTextures;
119  std::string m_indoorMapId;
120  int m_indoorMapFloorIndex;
121  };
122  }
123  }
124 }