23 #include <tbb/queuing_rw_mutex.h>
24 #include <tbb/spin_rw_mutex.h>
26 #include <boost/logic/tribool.hpp>
28 namespace MAKVRinTerra
30 class DtUnusedFeatureTileTracker;
32 template <
typename FS>
43 template <
typename FS>
46 #ifdef DtObjectDebugger_Enable
62 typedef typename FeatureSet::Feature
Feature;
65 typedef boost::shared_ptr<DtPagingFeatureSet>
Ptr;
69 typedef boost::shared_ptr<const Grid>
GridCPtr;
71 typedef boost::shared_ptr<const Leaf>
LeafCPtr;
78 typedef boost::shared_ptr<Config>
Ptr;
101 : inputFeatureSet(cfg.inputFeatureSet)
102 , unusedTileTracker(cfg.unusedTileTracker)
103 , taskQueue(cfg.taskQueue)
104 , tileFeatures(cfg.tileFeatures)
121 return Make(
new Config(cfg), bounds);
125 FS* filter(
const DtQuery&,
const boost::optional<DtFeatureGeometry>&,
DtLoadType)
const;
127 bool loaded(
double)
const;
129 bool isCacheable(
const boost::optional<DtFeatureGeometry>& area)
const;
130 void cacheEstimate(
double& time,
double&
size,
const boost::optional<DtFeatureGeometry>& area)
const;
133 const boost::optional<DtFeatureGeometry>& area,
146 template <
typename FS>
149 #ifdef DtObjectDebugger_Enable
170 const boost::optional<DtFeatureGeometry>&,
174 unsigned indexLevel = 0)
const = 0;
178 virtual boost::optional<unsigned>
sizeEstimate()
const = 0;
194 template <
typename FS>
195 template <
template <
class>
class PtrT>
213 std::string label()
const;
218 boost::optional<unsigned> sizeEstimate()
const;
224 Tile& getSubtile(
unsigned);
225 const Tile& getSubtile(
unsigned)
const;
227 bool loaded(
double)
const;
229 unsigned numberOfFeatures()
const;
252 template <
typename FS>
255 ,
public boost::enable_shared_from_this<typename DtPagingFeatureSet<FS>::Grid>
256 #ifdef DtObjectDebugger_Enable
263 const boost::optional<DtFeatureGeometry>&,
267 unsigned indexLevel)
const;
269 void cacheEstimate(
double& time,
double&
size,
const boost::optional<DtFeatureGeometry>& area)
const;
272 const boost::optional<DtFeatureGeometry>& area,
280 virtual bool makeLeaf(
unsigned)
const;
285 template <
typename FS>
289 #ifdef DtObjectDebugger_Enable
301 bool loaded(
double = 0)
const;
302 unsigned numberOfFeatures()
const;
311 const boost::optional<DtFeatureGeometry>&,
315 unsigned indexLevel)
const;
317 boost::optional<unsigned> sizeEstimate()
const;
321 std::string label()
const;
333 void start(
bool wait);
335 FS* createFeatureSet(FS*)
const;
336 void inputLoadedCallback();
DtPagingFeatureSet< FS >::SubsetPtr SubsetPtr
Definition: pagingFeatureSet.h:154
#define DT_DLL_features
stop complaining about multiple independent base classes for boost::noncopyable this should probably ...
Definition: featuresDefines.h:41
boost::shared_ptr< const Grid > GridCPtr
Definition: pagingFeatureSet.h:69
virtual boost::optional< unsigned > sizeEstimate() const =0
FeatureSet::ForEachFunction ForEachFunction
Definition: asyncLoadingFeatureSet.h:44
FeatureSet::Feature Feature
Definition: pagingFeatureSet.h:62
Class DtTerrainInterfaceConfig is a readable-writable class holding terrain interface configuration o...
Definition: terrainInterfaceConfig.h:32
boost::shared_ptr< const Leaf > LeafCPtr
Definition: pagingFeatureSet.h:71
boost::shared_ptr< Leaf > LeafPtr
Definition: pagingFeatureSet.h:70
Definition: pagingFeatureSet.h:200
tbb::spin_rw_mutex SizeMutex
Definition: pagingFeatureSet.h:240
FS::ForEachFunction ForEachFunction
Definition: pagingFeatureSet.h:294
boost::shared_ptr< Config > Ptr
Definition: pagingFeatureSet.h:78
boost::shared_ptr< const Subset > SubsetCPtr
Definition: pagingFeatureSet.h:67
boost::weak_ptr< DtUnusedFeatureTileTracker > WeakPtr
Definition: unusedFeatureTileTracker.h:53
Definition: asyncLoadingFeatureSet.h:163
Definition: pagingFeatureSet.h:196
FS * filter(const DtQuery &, const boost::optional< DtFeatureGeometry > &, DtLoadType) const
const Config & config() const
Definition: pagingFeatureSet.h:161
FS FeatureSet
Definition: pagingFeatureSet.h:61
const bool myEmptyFlag
Definition: pagingFeatureSet.h:249
Definition: featureSet.h:48
tbb::spin_mutex TileFeatureMutex
Definition: pagingFeatureSet.h:338
boost::optional< unsigned > mySizeEstimate
Definition: pagingFeatureSet.h:248
voidpf void uLong size
Definition: ioapi.h:39
void cacheEstimate(double &time, double &size, const boost::optional< DtFeatureGeometry > &area) const
Tile mySubtile3
Definition: pagingFeatureSet.h:246
virtual void updateStats()
TileFeatureMutex myTileFeatureMutex
Definition: pagingFeatureSet.h:339
const DtProj::Bounds myBounds
Definition: pagingFeatureSet.h:190
const DtProj::Bounds bounds
Definition: pagingFeatureSet.h:204
std::auto_ptr< DtTileFeature > myTileFeature
Definition: pagingFeatureSet.h:340
Default on in debug, off in release.
Definition: objectCounter.h:27
DtUnusedFeatureTileTracker::WeakPtr unusedTileTracker
Unused tile tracker which will manage the feature sets. This can be null and feature sets will be des...
Definition: pagingFeatureSet.h:87
DtPagingFeatureSet< FS >::GridCPtr GridCPtr
Definition: pagingFeatureSet.h:157
const SubsetPtr myParent
Definition: pagingFeatureSet.h:188
Definition: featureGeometry.h:60
Simple asynchronous callback queue.
Definition: vrfCallbackQueue.h:32
Definition: featureSet.h:60
FeatureSet::ForEachFunction ForEachFunction
Definition: pagingFeatureSet.h:63
FS * filter(const DtQuery &, const boost::optional< DtFeatureGeometry > &, DtLoadType) const
FS::DetachCallback DetachCallback
Definition: pagingFeatureSet.h:295
Tile mySubtile1
Definition: pagingFeatureSet.h:244
DtPagingFeatureSetSubset(const GridCPtr &parent, unsigned i)
DtPagingFeatureSet< FS >::Config Config
Definition: pagingFeatureSet.h:159
DtPagingFeatureSet< FS >::Grid Grid
Definition: pagingFeatureSet.h:156
virtual FS * filterCache(const DtQuery &, const boost::optional< DtFeatureGeometry > &, DtLoadType, SubsetCPtr &highestSubset, const DtProj::Bounds::LineSegment *=0, unsigned indexLevel=0) const =0
SizeMutex mySizeMutex
Definition: pagingFeatureSet.h:241
Definition: pagingFeatureSet.h:253
tbb::spin_mutex Mutex
Definition: pagingFeatureSet.h:140
static DtPagingFeatureSet * Make(Config *cfg, const DtProj::Bounds &bounds)
Factory functions for creating a pagetables.
Definition: pagingFeatureSet.h:112
Tile mySubtile2
Definition: pagingFeatureSet.h:245
DtPagingFeatureSetSubset< FS > Subset
Definition: pagingFeatureSet.h:56
int level() const
Definition: pagingFeatureSet.h:166
std::vector< typename Feature::CPtr > FeatureVector
Definition: pagingFeatureSet.h:297
Represents a set of characeters a DtFeature object can have. DtQuery objects are the way to communica...
Definition: query.h:38
FS::LoadedCallback LoadedCallback
Definition: pagingFeatureSet.h:211
Configuration object. Create an instance and change as desired.
Definition: pagingFeatureSet.h:75
Features pagetable class. This class is just the shell around a set of related classes. The general idea is a hierarchy of subsets/tiles from an arbitrary 2D coordsys. It uses weak pointers to manage its contained feature sets while returning feature sets which have shared pointers. This way feature sets will automatically be destroyed when users are done with them. The unused tile tracker can provide an owner for these feature sets and pages them out according to it's own policy.
Definition: featuresDebugger.h:31
SubsetPtr parent() const
Definition: pagingFeatureSet.h:165
DtPagingFeatureSet< FS >::SubsetCPtr SubsetCPtr
Definition: pagingFeatureSet.h:155
bool loaded(double) const
FeatureSet::DetachCallback DetachCallback
Definition: asyncLoadingFeatureSet.h:46
void cacheData(const boost::optional< DtFeatureGeometry > &area, DtFeatureCacheProgressCallback *progress) const
SubsetCPtr myTile
Definition: pagingFeatureSet.h:143
#define DT_DEFINE_OBJECT_DEBUGGER_NAME_TEMPLATE(type)
Definition: objectCounter.h:32
DtQueueLoadingFeatureSet< FeatureSet >::Queue Queue
Definition: pagingFeatureSet.h:79
Tile mySubtile0
Definition: pagingFeatureSet.h:243
FS::DetachCallback DetachCallback
Definition: pagingFeatureSet.h:210
class DT_DLL_features Grid
Definition: pagingFeatureSet.h:57
boost::shared_ptr< DtFeatureSet::Source > tileFeatures
Feature set used to represent tile boundaries This is only used for debug drawing currently...
Definition: pagingFeatureSet.h:94
boost::shared_ptr< Grid > GridPtr
Definition: pagingFeatureSet.h:68
const Config::Ptr myInfo
Definition: pagingFeatureSet.h:185
boost::shared_ptr< DtPagingFeatureSet > Ptr
Definition: pagingFeatureSet.h:65
DtFeatureSetWrapper< FS, boost::shared_ptr, DtPagingFeatureSetSubset< FS > > Base
Definition: pagingFeatureSet.h:51
DtFeatureSetWrapper< FS, PtrT, Subset > subtile
Definition: pagingFeatureSet.h:207
DtPagingFeatureSet * clone() const
const DtFeatureGeometry::Area myTileGeometry
Definition: pagingFeatureSet.h:191
DtLoadType
Used to indicate whether to load features. See DtFeatureSetTemplate::filter.
Definition: featureSet.h:36
class DT_DLL_features Leaf
Definition: pagingFeatureSet.h:59
const FS & input() const
Definition: pagingFeatureSet.h:162
static DtPagingFeatureSet * Make(const Config &cfg, const DtProj::Bounds &bounds)
Factory functions for creating a pagetables.
Definition: pagingFeatureSet.h:119
DtFeatureGeometry::Area tileGeometry() const
Definition: pagingFeatureSet.h:164
class DT_DLL_features GridTemplate
Definition: pagingFeatureSet.h:55
boost::weak_ptr< Queue > taskQueue
Task queue used for loading tiles.
Definition: pagingFeatureSet.h:90
Definition: pagingFeatureSet.h:147
boost::shared_ptr< FeatureSet > inputFeatureSet
Feature set the pagetable will read from.
Definition: pagingFeatureSet.h:82
boost::shared_ptr< Subset > SubsetPtr
Definition: pagingFeatureSet.h:66
const DtFeatureGeometry::Area tileGeometry
Definition: pagingFeatureSet.h:205
const int myLevel
Definition: pagingFeatureSet.h:186
Mutex myMutex
Definition: pagingFeatureSet.h:142
Config(const Config &cfg)
Copy constructor.
Definition: pagingFeatureSet.h:100
Represents a feature geometry.
Definition: featureGeometry.h:39
Definition: pagingFeatureSet.h:286
DtProj::Bounds bounds() const
Definition: pagingFeatureSet.h:163