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 <tbb/spin_rw_mutex.h>
20 
27 {
28 public:
33  explicit DtCutoutCache(
34  const DtFilename& filename,
35  const osgEarth::Profile* profile,
36  bool erasePrevious = false);
37 
39  virtual ~DtCutoutCache();
40 
42  struct Record
43  {
47 
48  Record();
49  };
50 
55  virtual std::shared_ptr<Record> read(const osgEarth::TileKey& key);
56 
59  virtual void write(
60  const osgEarth::TileKey& key,
61  const DtCollisionObjectList& objects,
62  const DtTileData::Extent::Vector& maskExtents);
63 
65  virtual void clear();
66 
67 protected:
68  void fillCache();
69 
71  const std::unique_ptr<DtObjectDB::Cursor> myCursor;
72 
74 
79 
80  typedef std::map<osgEarth::TileKey, std::shared_ptr<Record> > CacheMap;
81 
83  mutable tbb::spin_rw_mutex myCacheMutex;
84 
85  const std::string myCacheFilename;
86 };
DtTileData::Extent::Vector maskExtents
Definition: cutoutCache.h:46
DtU64 Offset
Definition: objectDB.h:30
const std::string myCacheFilename
Definition: cutoutCache.h:85
DtObjectDB::Offset myNextWriteLocationOffset
offset in the file where we store the offset where the record will be written.
Definition: cutoutCache.h:76
DtObjectDB::Ptr myObjectDB
Definition: cutoutCache.h:70
DtObjectDB::Offset myNextWriteLocation
offset in the file where the next record will be written.
Definition: cutoutCache.h:78
std::vector< Extent > Vector
Definition: tileData.h:48
const std::unique_ptr< DtObjectDB::Cursor > myCursor
Definition: cutoutCache.h:71
Data for masks in a given tilekey.
Definition: cutoutCache.h:42
tbb::spin_rw_mutex myCacheMutex
Definition: cutoutCache.h:83
std::shared_ptr< DtObjectDB > Ptr
Definition: objectDB.h:29
Contains DtCutoutCache. Binary db for storing cached osgearth cutouts.
Definition: cutoutCache.h:26
std::list< std::shared_ptr< btCollisionObject > > DtCollisionObjectList
Definition: bulletUtil.h:47
#define DT_DLL_vantageTerrainImplementation
This file is used to determine how to build.
Definition: vantageTerrainImplementationDefines.h:28
std::map< osgEarth::TileKey, std::shared_ptr< Record > > CacheMap
Definition: cutoutCache.h:80
osg::ref_ptr< const osgEarth::Profile > myProfile
Definition: cutoutCache.h:73
DtCollisionObjectList collisionObjects
Definition: cutoutCache.h:44
CacheMap myCacheMap
Definition: cutoutCache.h:82
unsigned numberOfTriangles
Definition: cutoutCache.h:45

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)