VR-Forces 4.2 Class Documentation
boundingVolumeTerrainSourceTracker.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2010 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
6 #pragma once
7 
10 
12 
18 
19 //Mak Terrain Toolkit includes
20 #include <geometry/sphere.h>
21 #include <boost/unordered_map.hpp>
22 
23 //VR-Link includes
24 #include <vlutil/vlSmartPointers.h>
25 
26 #include <tbb/spin_rw_mutex.h>
27 
28 #include <string>
29 #include <list>
30 #include <stack>
31 
34 
36 {
37  DtNodeBoundingInfo(DtSphere boundingSphere, std::string filename,
38  bool knownNotFound)
39  : myBoundingSphere(boundingSphere)
40  , myFilename(filename)
41  , myKnownNotFound(knownNotFound)
42  {
43 
44  }
45 
46  DtSphere myBoundingSphere;
47  std::string myFilename;
49 };
50 
51 
53 {
54  DtPagedNodeStatus(DtNodeBoundingInfo boundingInfo, unsigned int numTriangles,
55  unsigned int lastUsed = 0)
56  : myBoundingInfo(boundingInfo)
57  , myNumTriangles(numTriangles)
58  , myLastUsed(lastUsed)
59  , myPendingRemoval(false)
60  {
61 
62  }
63 
65  unsigned int myLastUsed;
66  unsigned int myNumTriangles;
68 };
69 
70 typedef DtBoost::shared_ptr< DtNodeBoundingInfo > DtNodeBoundingInfoPtr;
71 typedef DtBoost::shared_ptr< DtPagedNodeStatus > DtPagedNodeStatusPtr;
72 typedef std::list<DtNodeBoundingInfoPtr> DtNodeBoundingInfoList;
73 typedef boost::unordered_map<DtNodeId, DtNodeBoundingInfoPtr> DtNodeBoundingInfoMap;
74 typedef boost::unordered_map<DtNodeId, DtPagedNodeStatusPtr> DtPagedNodeStatusMap;
75 typedef boost::unordered_map<DtNodeId, int> DtNodeToChildCountMap;
76 
82  : public DtTerrainSourceTracker
83 {
84 public:
85 
87 
89 
90  virtual void updatePagedOutInfo(bool worldPagedOut,
91  const DtNodeBoundingInfoList& volumes);
92 
93  virtual void updatePagedInInfo(
94  const DtNodeBoundingInfoMap& volumes,
95  const unsigned int intersectId = 0);
96 
97  virtual void removePagedInInfo(DtNodeId node);
98 
99  virtual bool dataAvailable(DtPagingMetaDataPtr metaData,
100  DtTerrainPagingGeometryPtr geometry);
101 
102  virtual void pageInData(DtPagingMetaDataPtr metaData,
103  DtTerrainPagingGeometryPtr geometry);
104 
105  virtual void drawDebugInfo(btIDebugDraw* debugDrawer);
106 
107  virtual bool canPageOutData(unsigned int intersectId);
108 
109  virtual void pageOutOldestData(const int priority);
110 
111  virtual unsigned int findOldestPagedData(unsigned int& numTrianglesOut);
112 
113  virtual void printBoundingVolumes() const;
114 
115  virtual void setChildCount(DtNodeId node, const unsigned int& count);
116  virtual const unsigned int childCount(DtNodeId node);
117  virtual void removeChildCount(DtNodeId node);
118 
119 protected:
120 
121  virtual DtPageInGeometryCommand* createPageInGeometryCommand(
122  DtPagingMetaDataPtr metaData);
123 
124  virtual DtPageOutNodesCommand* createPageOutNodesCommand(
125  DtPagingMetaDataPtr metaData);
126 
127  virtual unsigned int getNumTriangles(DtNodeId node);
128 
129 protected:
130 
132 
136 
139 
141 
144 
146 
147 };
148 
149 
150 

Document ID: Generated on Sun Nov 24 19:49:21 EST 2013 from SVN revision 133924
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)