All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
TerrainPlaceholderInserter.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 #include "Types.h"
6 #include "Streaming.h"
7 #include <vector>
8 
9 namespace Eegeo
10 {
11  namespace Streaming
12  {
14  {
15  public:
17  PayloadPool* pPayloadPool,
18  QuadTreeNodePool* pQuadTreeNodePool,
19  IResourceStream* pTerrainStream,
20  PayloadSlotStreamMap* pStreamMap,
21  int minTerrainDepth,
22  int maxTerrainDepth) :
23  m_pPayloadPool(pPayloadPool),
24  m_pQuadTreeNodePool(pQuadTreeNodePool),
25  m_pTerrainStream(pTerrainStream),
26  m_pStreamMap(pStreamMap),
27  m_terrainPayloadSlot(-1),
28  m_terrainMinDepth(minTerrainDepth),
29  m_terrainMaxDepth(maxTerrainDepth)
30  {
31  }
32 
33  int terrainPayloadSlot() const { return m_terrainPayloadSlot; }
34  void InsertPlaceholders(std::vector<QuadTreeNode*>& nodeList, int updateCount);
35  void OnStreamsChanged();
36 
37  private:
38  PayloadPool* m_pPayloadPool;
39  QuadTreeNodePool* m_pQuadTreeNodePool;
40  IResourceStream* m_pTerrainStream;
41  PayloadSlotStreamMap* m_pStreamMap;
42  int m_terrainPayloadSlot;
43  const int m_terrainMinDepth;
44  const int m_terrainMaxDepth;
45 
46  bool InsertAdditionalQuadTreeNodesBelow(QuadTreeNode* node, int updateCount);
47  QuadTreeNode* CreateChildAtIndex(QuadTreeNode* parentNode, int childIndex);
48  void CreatePlaceholder(QuadTreeNode* quadTreeNode, bool dontLoadOnTopOf, int updateCount);
49  bool IsTerrainLeaf(QuadTreeNode* quadTreeNode);
50  bool HasNoTerrainChildrenInSceneGraph(QuadTreeNode* quadTreeNode);
51  };
52  }
53 }