All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
HeatmapShapeModel.h
1 #pragma once
2 
3 #include "HeatmapShapes.h"
4 #include "ShapeModelBase.h"
5 #include "DoublePlane.h"
6 #include "StencilMapLayerMask.h"
7 
8 namespace Eegeo
9 {
10  namespace Shapes
11  {
12  namespace Heatmaps
13  {
15  {
16  public:
18 
20  IShapeModel::IdType heatmapId,
21  const Resources::Interiors::InteriorId& indoorMapId,
22  int indoorMapFloorId,
23  const dv3& originEcef,
24  const ShapeModelBase::PointOnMapVector& points,
25  const std::vector<double>& perPointElevations,
26  double elevation,
27  const std::vector<u16>& geometryIndices,
28  const Space::LatLong& boundsSouthWest,
29  const Space::LatLong& boundsNorthEast,
30  const std::vector<v3>& untransformedPointsLocalEcef,
31  const Geometry::DoublePlane& polygonBestFitPlane,
32  const std::vector<Eegeo::Space::WeightedLatLongAltitude>& weightedPoints,
33  double weightMin,
34  double weightMax,
35  const v2& textureDimensions,
36  float textureBorderPercent,
37  const std::vector<float>& heatmapDensityStops,
38  const std::vector<double>& heatmapRadiiMeters,
39  const std::vector<double>& heatmapGains,
40  bool useApproximation,
41  float densityBlend,
42  bool interpolateDensityByZoom,
43  double zoomMin,
44  double zoomMax,
45  float opacity,
46  float intensityBias,
47  float intensityScale,
48  u32 occludedStencilMapLayerMask,
49  float occludedAlpha,
50  float occludedSaturation,
51  float occludedBrightness,
52  const std::vector<float>& gradientStops,
53  const std::vector<v4>& gradientColors,
54  ShapeModelChangedEvent& shapeModelChangedEvent,
55  IHeatmapGeometryChangedEvent& heatmapGeometryChangedEvent,
56  IHeatmapGradientChangedEvent& heatmapGradientChangedEvent,
57  IHeatmapDataChangedEvent& heatmapDataChangedEvent,
58  IHeatmapUniformsChangedEvent& heatmapUniformsChangedEvent
59  );
60 
61  virtual ~HeatmapShapeModel();
62 
63  void SetData(
64  const std::vector<Eegeo::Space::WeightedLatLongAltitude>& weightedPoints,
65  double weightMin,
66  double weightMax
67  );
68 
69  void SetHeatmapDensities(
70  const std::vector<float>& heatmapDensityStops,
71  const std::vector<double>& heatmapRadiiMeters,
72  const std::vector<double>& heatmapGains
73  );
74 
75  void SetUseApproximation(bool useApproximation);
76 
77  void SetDensityBlend(float densityBlend);
78 
79  void SetInterpolateDensityByZoom(bool interpolateDensityByZoom);
80 
81  void SetZoomMin(double zoomMin);
82 
83  void SetZoomMax(double zoomMax);
84 
85  void SetIntensityBias(float intensityBias);
86 
87  void SetIntensityScale(float intensityScale);
88 
89  void SetOpacity(float opacity);
90 
91  void SetOccludedStyleAlpha(float alpha);
92 
93  void SetOccludedStyleSaturation(float alpha);
94 
95  void SetOccludedStyleBrightness(float brightness);
96 
97  // Eegeo::Rendering::StencilMapLayerMask::Type
98  void SetOccludedStencilMapLayerMask(u32 occludedStencilMapLayerMask);
99 
100  void SetGradient(
101  const std::vector<float>& gradientStops,
102  const std::vector<v4>& gradientColors
103  );
104 
105  void SetTextureDimensions(const v2& textureDimensions);
106 
107  const std::vector<Eegeo::Space::WeightedLatLongAltitude>& GetWeightedPoints() const { return m_weightedPoints; }
108 
109  double GetWeightMin() const { return m_weightMin; }
110 
111  double GetWeightMax() const { return m_weightMax; }
112 
113  const v2& GetTextureDimensions() const { return m_textureDimensions; }
114 
115  float GetTextureBorderPercent() const { return m_textureBorderPercent; }
116 
117  const std::vector<float>& GetHeatmapDensityStops() const { return m_heatmapDensityStops; }
118 
119  const std::vector<double>& GetHeatmapRadiiMeters() const { return m_heatmapRadiiMeters; }
120 
121  const std::vector<double>& GetHeatmapGains() const { return m_heatmapGains; }
122 
123  bool GetUseApproximation() const { return m_useApproximation; }
124 
125  float GetDensityBlend() const { return m_densityBlend; }
126 
127  bool GetInterpolateDensityByZoom() const { return m_interpolateDensityByZoom; }
128 
129  double GetZoomMin() const { return m_zoomMin; }
130 
131  double GetZoomMax() const { return m_zoomMax; }
132 
133  float GetIntensityBias() const { return m_intensityBias; }
134 
135  float GetIntensityScale() const { return m_intensityScale; }
136 
137  float GetOpacity() const { return m_opacity; }
138 
139  u32 GetOccludedStencilMapLayerMask() const { return m_occludedStencilMapLayerMask; }
140  u32 GetNonOccludedStencilMapLayerMask() const;
141  float GetOccludedAlpha() const { return m_occludedAlpha; }
142  float GetOccludedSaturation() const { return m_occludedSaturation; }
143  float GetOccludedBrightness() const { return m_occludedBrightness; }
144 
145  const std::vector<float>& GetGradientStops() const { return m_gradientStops; }
146  const std::vector<v4>& GetGradientColors() const { return m_gradientColors; }
147 
148  const Geometry::DoublePlane& GetProjectionPlane() const { return m_polygonBestFitPlane; }
149 
150  const std::vector<v3>& GetUntransformedPointsLocalEcef() const { return m_untransformedPointsLocalEcef; }
151 
152  HeatmapStats CalculateStats() const;
153 
154  protected:
155  virtual void NotifyPointOnMapChanged();
156 
157  private:
158 
159  const std::vector<v3> m_untransformedPointsLocalEcef;
160  Geometry::DoublePlane m_polygonBestFitPlane;
161 
162  std::vector<Eegeo::Space::WeightedLatLongAltitude> m_weightedPoints;
163  double m_weightMin;
164  double m_weightMax;
165 
166  v2 m_textureDimensions;
167  float m_textureBorderPercent;
168  std::vector<float> m_heatmapDensityStops;
169  std::vector<double> m_heatmapRadiiMeters;
170  std::vector<double> m_heatmapGains;
171  bool m_useApproximation;
172  float m_densityBlend;
173  bool m_interpolateDensityByZoom;
174  double m_zoomMin;
175  double m_zoomMax;
176  float m_opacity;
177  float m_intensityBias;
178  float m_intensityScale;
179 
180  // StencilMapLayerMask
181  u32 m_occludedStencilMapLayerMask;
182 
183  float m_occludedAlpha;
184  float m_occludedSaturation;
185  float m_occludedBrightness;
186 
187  std::vector<float> m_gradientStops;
188  std::vector<v4> m_gradientColors;
189 
190  ShapeModelChangedEvent& m_shapeModelChangedEvent;
191  IHeatmapGeometryChangedEvent& m_heatmapGeometryChangedEvent;
192  IHeatmapGradientChangedEvent& m_heatmapGradientChangedEvent;
193  IHeatmapDataChangedEvent& m_heatmapDataChangedEvent;
194  IHeatmapUniformsChangedEvent& m_heatmapUniformsChangedEvent;
195  };
196 
198  {
199  public:
200  HeatmapStats(
201  double dataMin,
202  double dataMax,
203  double dataMean,
204  double dataStandardDeviation
205  );
206 
207  double GetDataMin() const { return m_dataMin; }
208  double GetDataMax() const { return m_dataMax; }
209  double GetDataMean() const { return m_dataMean; }
210  double GetDataStandardDeviation() const { return m_dataStandardDeviation; }
211  private:
212  double m_dataMin;
213  double m_dataMax;
214  double m_dataMean;
215  double m_dataStandardDeviation;
216  };
217  }
218  }
219 }