VR-Forces 4.5 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DtCDBTileCache.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2016 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 #pragma once
10 
11 #include <string>
12 #include <osg/ref_ptr>
13 #include <osg/Image>
14 #include <osg/Shape>
15 #include <osgEarth/GeoData>
16 #include <OpenThreads/Mutex>
17 #include <map>
18 #include <queue>
19 #include "DtCDBExport.h"
20 
21 namespace makVrv { namespace oe { namespace CDB
22 {
29  {
30  public:
31 
33  CDBTileCache();
34 
36  virtual ~CDBTileCache();
37 
40  void createCdbGeoCellIndex(const std::string& CdbRootPath, osgEarth::GeoExtent& CdbGeoExtent, bool readMaxLod);
41 
43  bool isCdbGeocellAvailable(const std::string& latitude, const std::string& longitude);
44 
46  bool isCdbGeoCellIndexCreated() const;
47 
49  osg::Image* image(const std::string& CdbTile);
50 
52  void addImage(const std::string& CdbTile, osg::ref_ptr< osg::Image > rbgImage);
53 
55  float imageHitPercentage();
56 
58  osg::HeightField* heightField(const std::string& CdbTile);
59 
61  void addHeightField(const std::string& CdbTile, osg::ref_ptr< osg::HeightField > elevation);
62 
64  float heightFieldHitPercentage();
65 
67  void setCacheSize(int cacheSize);
68 
70  int cacheSize();
71 
73  int maxElevationLod() const;
74 
76  int maxImageryLod() const;
77 
78 
79  private:
80 
82  std::map<std::string, osg::ref_ptr< osg::Image > > myCdbImgaryMap;
83 
85  std::queue<std::string> myCdbImgaryQueue;
86 
88  std::map<std::string, osg::ref_ptr< osg::HeightField > > myCdbElevationMap;
89 
91  std::queue<std::string> myCdbElevationQueue;
92 
94  size_t myNbCacheSize;
95 
97  unsigned long myImageRequestCount;
98 
100  unsigned long myImageCacheHit;
101 
103  unsigned long myElevationRequestCount;
104 
106  unsigned long myElevationCacheHit;
107 
110 
112  typedef std::map<std::string, bool> DtLogitudeGeocellMap;
113 
115  static std::map<std::string, DtLogitudeGeocellMap> theCdbGeoCellMap;
116 
118  static int theMaxElevationLod;
119 
121  static int theMaxImageryLod;
122 
124  static int theMinLongitude;
125 
127  static int theMaxLongitude;
128 
130  static int theMinLatitude;
131 
133  static int theMaxLatitude;
134 
136  OpenThreads::Mutex myMutex;
137  };
138 
139 } } } // namespace mak::osgEarth::CDB
140 
141 

Document ID: Generated on Thu Mar 23 18:54:12 EDT 2017 from SVN revision 174804
Copyright © 2005-2017 VT MÄK. All Rights Reserved (www.mak.com)