VR-Forces 4.7 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 
13 //Mak Terrain Toolkit includes
14 #include <geometry/sphere.h>
16 #include <boost/unordered_map.hpp>
17 
23 
24 //VR-Link includes
25 #include <vlutil/vlSmartPointers.h>
26 #include <matrix/coordTransform.h>
27 
28 #include <tbb/spin_rw_mutex.h>
29 
30 #include <string>
31 #include <list>
32 #include <stack>
33 
37 class DtLocalVertexList;
38 
40 
41 
47  : public DtTerrainSourceTracker
48 {
49 public:
50 
51  //Struct defining the elemnt to add to the spatial subdivision for paged-in
52  //nodes. This is a different data structure from the paged-out nodes because
53  //there is additional data.
55  {
57  : myId(id)
58  , myStatus(status)
59  {
60 
61  }
62 
63  DtNodeStatusSSELement(std::pair<DtNodeId, DtPagedNodeStatusPtr> idStatusPair)
64  : myId(idStatusPair.first)
65  , myStatus(idStatusPair.second)
66  {
67 
68  }
69 
70  DtExtent extent()
71  {
72  return myStatus->myBoundingInfo.extent();
73  }
74 
75  void expandExtent(DtExtent& extent) const
76  {
77  myStatus->myBoundingInfo.expandExtent(extent);
78  }
79 
82  };
83  typedef boost::shared_ptr<DtNodeStatusSSELement> DtNodeStatusSSElementPtr;
84 
87 
89 
91 
92  virtual void updatePagedOutInfo(const DtNodeBoundingInfoList& volumes, bool invalid = false);
93 
96  virtual void updatePagedOutInfo(
97  const DtNodeBoundingInfoList& volumes,
98  const DtNodeBoundingInfoList& removed,
99  bool invalid = false);
100 
101  virtual void updatePagedInInfo(
102  const DtNodeBoundingInfoMap& volumes,
103  DtTerrainIntersectIDType intersectId = 0);
104 
105  virtual void removePagedInInfo(DtNodeId node);
106 
107  virtual bool dataAvailable(DtPagingMetaDataPtr metaData,
108  DtTerrainPagingGeometryPtr geometry);
109 
110  virtual void pageInData(DtPagingMetaDataPtr metaData,
111  DtTerrainPagingGeometryPtr geometry);
112 
113  virtual bool canPageOutData(DtTerrainIntersectIDType intersectId);
114 
115  virtual void pageOutOldestData(const int priority);
116 
117  virtual DtTerrainIntersectIDType findOldestPagedData(unsigned int& numTrianglesOut);
118 
119  virtual void printInfo() const;
120 
121  virtual bool getPagedOutNodes(DtTerrainPagingGeometryPtr geometry,
122  DtNodeBoundingInfoSet& nodes);
123 
124  virtual bool getPagedInNodes(DtTerrainPagingGeometryPtr geometry,
125  DtPagedNodeStatusMap& nodes);
126 
127 protected:
128 
129  virtual bool getPagedOutNodes(const DtSphere& sphere,
130  DtNodeBoundingInfoSet& nodes);
131  virtual bool getPagedOutNodes(const DtLocalVertexList& vertexList,
132  DtNodeBoundingInfoSet& nodes);
133  virtual bool getPagedOutNodes(const DtChord& chord,
134  DtNodeBoundingInfoSet& nodes);
135 
136  virtual bool getPagedInNodes(const DtSphere& sphere,
137  DtPagedNodeStatusMap& nodes);
138  virtual bool getPagedInNodes(const DtLocalVertexList& vertexList,
139  DtPagedNodeStatusMap& nodes);
140  virtual bool getPagedInNodes(const DtChord& chord,
141  DtPagedNodeStatusMap& nodes);
142 
143  virtual DtTerrainIntersectIDType findOldestPagedDataUnlocked(unsigned int& numTrianglesOut);
144 
145  virtual DtPageInGeometryCommand* createPageInGeometryCommand(
146  DtPagingMetaDataPtr metaData);
147 
148  virtual DtPageOutNodesCommand* createPageOutNodesCommand(
149  DtPagingMetaDataPtr metaData);
150 
151  virtual unsigned int getNumTriangles(DtNodeId node);
152 
153 protected:
157 
160 
162 
164  tbb::atomic<bool> myRecomputeOldestPagedObject;
165 
172 };
173 
174 
175 

Document ID: Generated on Fri Apr 26 21:53:14 EDT 2019 from SVN revision 197883
Copyright © 2005-2019 VT MAK. All Rights Reserved (www.mak.com)