VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
cutoutCache.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2020 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
10 
11 #pragma once
12 
16 
17 #include <vrfutil/objectDB.h>
18 
19 #include <boost/scoped_ptr.hpp>
20 
21 #include <tbb/spin_rw_mutex.h>
22 
29 {
30 public:
35  explicit DtCutoutCache(
36  const DtFilename& filename,
37  const osgEarth::Profile* profile,
38  bool erasePrevious = false);
39 
41  virtual ~DtCutoutCache();
42 
44  struct Record
45  {
49 
50  Record();
51  };
52 
57  virtual boost::shared_ptr<Record> read(const osgEarth::TileKey& key);
58 
61  virtual void write(
62  const osgEarth::TileKey& key,
63  const DtCollisionObjectList& objects,
64  const DtTileData::Extent::Vector& maskExtents);
65 
67  virtual void clear();
68 
69 protected:
70  void fillCache();
71 
73  boost::scoped_ptr<DtObjectDB::Cursor> myCursor;
74 
76 
81 
82  typedef std::map<osgEarth::TileKey, boost::shared_ptr<Record> > CacheMap;
83 
85  mutable tbb::spin_rw_mutex myCacheMutex;
86 
87  const std::string myCacheFilename;
88 };
boost::shared_ptr< DtObjectDB > Ptr
Definition: objectDB.h:30
boost::scoped_ptr< DtObjectDB::Cursor > myCursor
Definition: cutoutCache.h:73
DtTileData::Extent::Vector maskExtents
Definition: cutoutCache.h:48
DtU64 Offset
Definition: objectDB.h:31
const std::string myCacheFilename
Definition: cutoutCache.h:87
DtObjectDB::Offset myNextWriteLocationOffset
offset in the file where we store the offset where the record will be written.
Definition: cutoutCache.h:78
DtObjectDB::Ptr myObjectDB
Definition: cutoutCache.h:72
DtObjectDB::Offset myNextWriteLocation
offset in the file where the next record will be written.
Definition: cutoutCache.h:80
std::vector< Extent > Vector
Definition: tileData.h:49
std::map< osgEarth::TileKey, boost::shared_ptr< Record > > CacheMap
Definition: cutoutCache.h:82
Data for masks in a given tilekey.
Definition: cutoutCache.h:44
tbb::spin_rw_mutex myCacheMutex
Definition: cutoutCache.h:85
Contains DtCutoutCache. Binary db for storing cached osgearth cutouts.
Definition: cutoutCache.h:28
#define DT_DLL_vantageTerrainImplementation
This file is used to determine how to build.
Definition: vantageTerrainImplementationDefines.h:28
osg::ref_ptr< const osgEarth::Profile > myProfile
Definition: cutoutCache.h:75
DtCollisionObjectList collisionObjects
Definition: cutoutCache.h:46
CacheMap myCacheMap
Definition: cutoutCache.h:84
std::list< boost::shared_ptr< btCollisionObject > > DtCollisionObjectList
Definition: bulletUtil.h:49
unsigned numberOfTriangles
Definition: cutoutCache.h:47

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)