VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtCDBTileKey.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright(c) 2025 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
10 #pragma once
11 
13 
14 #include <string>
15 
16 #include <osgEarth/GeoData>
17 
18 namespace osgEarth
19 {
20  class Map;
21 }
22 
23 namespace makVrv
24 {
25  namespace oe
26  {
27  namespace CDB
28  {
29  class CDBTileCache;
30  class CDBTile;
31 
32  enum Quadrant
33  {
36  , UPPER_LEFT = 2
39  , INVALID = -1
40  };
41 
47  {
48  public:
49 
52  CDBTileKey( int lod, int lon, int lat, int rref, int uref );
53 
55  CDBTileKey( const CDBTileKey& rhs );
56 
58  ~CDBTileKey();
59 
61  std::string str() const;
62 
64  int getLon() const;
65 
67  int getLat() const;
68 
70  int getURef() const;
71 
73  int getRRef() const;
74 
76  int getLOD() const;
77 
79  const osgEarth::GeoExtent& getExtent() const;
80 
82  bool getChildren( std::vector< CDBTileKey >& children ) const;
83 
85  static int calcDLonZone( double coord_y );
86 
88  static void getTileDimensions( int lod, int lon, int lat, int rref, int uref, double& out_width, double& out_height );
89 
91  static void createRootKeys( const CDBTileCache& tileCache, std::vector< CDBTileKey >& rootKeys );
92 
94  static double getApproximateLodGridSpacing( int lod );
95 
97  osg::BoundingSphere getBounds( const osgEarth::Map* map ) const;
98 
100  bool equals( int lod, int uref, int rref ) const;
101 
103  bool equals( const CDBTileKey& key ) const;
104 
106  size_t getLatLongHash( void ) const;
107 
108  size_t getFullHash( void ) const;
109  size_t getHashNoLod( void ) const;
110 
113  void setCdbTile( CDBTile* tile );
114 
116  CDBTile* cdbTile() const;
117 
118  std::string latString() const;
119  std::string lonString() const;
120  std::string lodString() const;
121  std::string uRefString() const;
122  std::string rRefString() const;
123  protected:
124 
126  int myLod;
127 
129  int myURef;
130 
132  int myRRef;
133 
135  int myLon;
136 
138  int myLat;
139 
141  osgEarth::GeoExtent myExtent;
142 
144  std::string myLatStr;
145  std::string myLonStr;
146  std::string myURefStr;
147  std::string myRRefStr;
148  std::string myLodStr;
149  };
150 
152  std::ostream& operator<<( std::ostream& os, const CDBTileKey& key );
153 
156  {
157  size_t operator()( const makVrv::oe::CDB::CDBTileKey& tileKey ) const
158  {
159  return tileKey.getLatLongHash();
160  }
161  };
162 
165  {
167  {
168  return lhs.getLatLongHash() == rhs.getLatLongHash();
169  }
170  };
171 
174  {
175  size_t operator()( const makVrv::oe::CDB::CDBTileKey& tileKey ) const
176  {
177  return tileKey.getFullHash();
178  }
179  };
180 
183  {
185  {
186  if( lhs.getLat() != rhs.getLat() ) return false;
187  if( lhs.getLon() != rhs.getLon() ) return false;
188  if( lhs.getLOD() != rhs.getLOD() ) return false;
189  if( lhs.getURef() != rhs.getURef() ) return false;
190  if( lhs.getRRef() != rhs.getRRef() ) return false;
191  return true;
192  }
193  };
194  }
195  }
196 }// namespace makVrv::oe::CDB
CDBTile * myCdbTile
Definition: DtCDBTileKey.h:143
Tile Key equal operation.
Definition: DtCDBTileKey.h:182
CDB Tile cache manager Used by CDBTileSource to try to avoid reading the the same CDB tile many time ...
Definition: DtCDBTileCache.h:34
Hold the unique CDB tile key information CDB LOD goes from -10 to 23. Negative keys to zero are all 1...
Definition: DtCDBTileKey.h:46
Definition: DtCDBTileKey.h:36
size_t operator()(const makVrv::oe::CDB::CDBTileKey &tileKey) const
Definition: DtCDBTileKey.h:175
#define DT_DLL_OSGEARTH_CDB_UTILS
Definition: DtCDBExport.h:18
int getURef() const
Get the upper direction index of this CDBTileKey.
osgEarth::GeoExtent myExtent
Tile Extent.
Definition: DtCDBTileKey.h:141
int myLod
Tile Level Of Detail.
Definition: DtCDBTileKey.h:126
Latitude Longitude equal operation.
Definition: DtCDBTileKey.h:164
bool operator()(const makVrv::oe::CDB::CDBTileKey &lhs, const makVrv::oe::CDB::CDBTileKey &rhs) const
Definition: DtCDBTileKey.h:184
std::string myRRefStr
Definition: DtCDBTileKey.h:147
std::string myLonStr
Definition: DtCDBTileKey.h:145
Class used to find CDB Tiles information.
Definition: DtCDBTile.h:52
int myLon
Tile Longitude.
Definition: DtCDBTileKey.h:135
std::ostream & operator<<(std::ostream &os, const CDBTileKey &key)
Output the CDB Tile Key stream representation.
Latitude Longitude hash key.
Definition: DtCDBTileKey.h:155
int myLat
Tile Latitude.
Definition: DtCDBTileKey.h:138
Definition: DtCDBTileKey.h:38
Definition: DtCDBTileKey.h:39
int myRRef
Tile Right index Reference.
Definition: DtCDBTileKey.h:132
int getLat() const
Get the lat coordinate of this CDBTileKey.
std::string myLatStr
Definition: DtCDBTileKey.h:144
Definition: DtCDBTileKey.h:35
int myURef
Tile Upper index Reference.
Definition: DtCDBTileKey.h:129
Quadrant
Definition: DtCDBTileKey.h:32
bool operator()(const makVrv::oe::CDB::CDBTileKey &lhs, const makVrv::oe::CDB::CDBTileKey &rhs) const
Definition: DtCDBTileKey.h:166
Complete tile key hash.
Definition: DtCDBTileKey.h:173
int getLOD() const
Get the level of detail for this CDBTileKey.
Definition: DtCDBTileKey.h:34
Definition: DtCDBTileKey.h:37
size_t operator()(const makVrv::oe::CDB::CDBTileKey &tileKey) const
Definition: DtCDBTileKey.h:157
size_t getFullHash(void) const
size_t getLatLongHash(void) const
Utility function to get hash off of lat, lon.
std::string myURefStr
Definition: DtCDBTileKey.h:146
int getLon() const
Get the lon coordinate of this CDBTileKey.
std::string myLodStr
Definition: DtCDBTileKey.h:148
int getRRef() const
Get the right direction index this CDBTileKey.

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)