All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
TerrainHeightRepository.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 #include "Types.h"
6 #include "MortonKey.h"
7 #include "Terrain.h"
8 #include <vector>
9 #include <map>
10 
11 namespace Eegeo
12 {
13  namespace Resources
14  {
15  namespace Terrain
16  {
17  namespace Heights
18  {
20  {
21  private:
22  std::map<Eegeo::Streaming::MortonKey, ITerrainHeightLookup*, Eegeo::Streaming::MortonKeyCompare> m_resources;
23 
24  void CallAddedCallbacks(const ITerrainHeightLookup& terrainHeightLookup);
25  void CallRemovalCallbacks(const ITerrainHeightLookup& terrainHeightLookup);
26 
27  std::vector<ITerrainHeightsCallback*> m_addedCallbacks;
28  std::vector<ITerrainHeightsCallback*> m_removalCallbacks;
29 
30  public:
31 
32  void AddHeights(Eegeo::Streaming::MortonKey key, ITerrainHeightLookup* heights);
33 
34  void RemoveHeights(Eegeo::Streaming::MortonKey key);
35 
37 
38  float GetMaxHeight() const;
39  float GetMinHeight() const;
40 
41  void RegisterAddedCallback(ITerrainHeightsCallback* callback);
42  void UnregisterAddedCallback(ITerrainHeightsCallback* callback);
43 
44  void RegisterRemovalCallback(ITerrainHeightsCallback* callback);
45  void UnregisterRemovalCallback(ITerrainHeightsCallback* callback);
46  };
47  }
48  }
49  }
50 }