VR-Forces 4.1 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 
22 //VR-Link includes
23 #include <vlutil/vlSmartPointers.h>
24 
25 #include <tbb/spin_rw_mutex.h>
26 
27 #include <string>
28 #include <list>
29 #include <stack>
30 
33 
35 {
36  DtNodeBoundingInfo(DtSphere boundingSphere, std::string filename,
37  bool knownNotFound)
38  : myBoundingSphere(boundingSphere)
39  , myFilename(filename)
40  , myKnownNotFound(knownNotFound)
41  {
42 
43  }
44 
46  std::string myFilename;
48 };
49 
50 
52 {
53  DtPagedNodeStatus(DtNodeBoundingInfo boundingInfo, unsigned int numTriangles,
54  unsigned int lastUsed = 0)
55  : myBoundingInfo(boundingInfo)
56  , myNumTriangles(numTriangles)
57  , myLastUsed(lastUsed)
58  , myPendingRemoval(false)
59  {
60 
61  }
62 
64  unsigned int myLastUsed;
65  unsigned int myNumTriangles;
67 };
68 
69 typedef DtBoost::shared_ptr< DtNodeBoundingInfo > DtNodeBoundingInfoPtr;
70 typedef DtBoost::shared_ptr< DtPagedNodeStatus > DtPagedNodeStatusPtr;
71 typedef std::list<DtNodeBoundingInfoPtr> DtNodeBoundingInfoList;
72 typedef std::map<DtNodeId, DtNodeBoundingInfoPtr> DtNodeBoundingInfoMap;
73 typedef std::map<DtNodeId, DtPagedNodeStatusPtr> DtPagedNodeStatusMap;
74 typedef std::map<DtNodeId, int> DtNodeToChildCountMap;
75 
81  : public DtTerrainSourceTracker
82 {
83 public:
84 
86 
88 
89  virtual void updatePagedOutInfo(bool worldPagedOut,
90  const DtNodeBoundingInfoList& volumes);
91 
92  virtual void updatePagedInInfo(
93  const DtNodeBoundingInfoMap& volumes,
94  const unsigned int intersectId = 0);
95 
96  virtual void removePagedInInfo(DtNodeId node);
97 
98  virtual bool dataAvailable(DtPagingMetaDataPtr metaData,
100 
101  virtual void pageInData(DtPagingMetaDataPtr metaData,
102  DtTerrainPagingGeometryPtr geometry);
103 
104  virtual void drawDebugInfo(btIDebugDraw* debugDrawer);
105 
106  virtual bool canPageOutData(unsigned int intersectId);
107 
108  virtual void pageOutOldestData(const int priority);
109 
110  virtual unsigned int findOldestPagedData(unsigned int& numTrianglesOut);
111 
112  virtual void printBoundingVolumes() const;
113 
114  virtual void setChildCount(DtNodeId node, const unsigned int& count);
115  virtual const unsigned int childCount(DtNodeId node);
116  virtual void removeChildCount(DtNodeId node);
117 
118 protected:
119 
120  virtual DtPageInGeometryCommand* createPageInGeometryCommand(
121  DtPagingMetaDataPtr metaData);
122 
123  virtual DtPageOutNodesCommand* createPageOutNodesCommand(
124  DtPagingMetaDataPtr metaData);
125 
126  virtual unsigned int getNumTriangles(DtNodeId node);
127 
128 protected:
129 
131 
135 
138 
140 
143 
145 
146 };
147 
148 
149 

Document ID: Generated on Tue Jan 29 18:21:16 EST 2013 from SVN revision 123193
Copyright © 2005-2013 VT MÄK Inc. All Rights Reserved (www.mak.com)