All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
QuadTreeVisibilityUpdater.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 "QuadTreeNodeVisitParams.h"
8 #include "PayloadSlotStream.h"
9 #include <vector>
10 
11 namespace Eegeo
12 {
13  namespace Streaming
14  {
16  {
17  public:
18 
19  private:
20  QuadTreeNodePool *m_pNodePool;
21  PayloadPool *m_pPayloadPool;
22  PayloadSlotStreamMap *m_pPayloadSlotStreamMap;
23  SceneGraphCellRepository& m_sceneGraphCellRepository;
24 
25  std::vector<QuadTreeNodeVisitParams> m_stack;
26  std::vector<std::vector<int> > m_nodeCountListsByFace;
27 
28 
29  public:
31  PayloadPool *pPayloadPool,
32  PayloadSlotStreamMap* pPayloadSlotStreamMap,
33  SceneGraphCellRepository& sceneGraphCellRepository);
34 
35 
36  void updateVisibleNodes(QuadTreeCube * pQuadCube,
37  IStreamingVolume& streamingVolume,
38  int updateCount,
39  std::vector<QuadTreeNode*>& nodesRequiringPlaceholders,
40  int terrainPayloadIndex,
41  std::vector<MortonKey>& keysThatAreNowVisible,
42  std::vector<MortonKey>& keysThatAreNoLongerVisible,
43  std::vector<MortonKey>& currentlyVisibleKeys);
44 
45  int numOfNodesOnFaceAtDepth(int faceIndex, int depth);
46 
47  private:
48  void clearNodeCounts();
49 
50  void updateVisibleNodesOnFace(int faceIndex,
51  IStreamingVolume& streamingVolume,
52  QuadTreeNode* pRootNode,
53  int updateCount,
54  std::vector<QuadTreeNode*>& nodesRequiringPlaceholders,
55  int terrainPayloadIndex,
56  std::vector<MortonKey>& keys,
57  std::vector<MortonKey>& keysThatAreNowVisible,
58  std::vector<MortonKey>& keysThatAreNoLongerVisible,
59  std::vector<MortonKey>& currentlyVisibleKeys);
60 
61  void updateNodePayloads(QuadTreeNode* pRootNode,
62  const std::vector<PayloadSlotStream> &streamEntryList,
63  uint updateCount,
64  uint slotsAboveInSceneGraph,
65  std::vector<QuadTreeNode*>& nodesRequiringPlaceholders,
66  int terrainPayloadIndex);
67 
68  uint findSlotsInSceneGraph(QuadTreeNode* node);
69  };
70  }
71 }