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 
14 
15 #include <string>
16 
17 #include <osgEarth/GeoData>
18 
19 namespace osgEarth
20 {
21  class Map;
22 }
23 
24 namespace makVrv
25 {
26  namespace oe
27  {
28  namespace CDB
29  {
30  class CDBTileCache;
31  class CDBTile;
32 
33  enum Quadrant
34  {
37  , UPPER_LEFT = 2
40  , INVALID = -1
41  };
42 
48  {
49  public:
50 
53  CDBTileKey( int lod, int lon, int lat, int rref, int uref );
54 
56  CDBTileKey( const CDBTileKey& rhs );
57 
59  CDBTileKey( const CDBTileVerbose& verboseKey );
60 
62  ~CDBTileKey();
63 
65  std::string str() const;
66 
68  int getLon() const;
69 
71  int getLat() const;
72 
74  int getURef() const;
75 
77  int getRRef() const;
78 
80  int getLOD() const;
81 
83  const osgEarth::GeoExtent& getExtent() const;
84 
86  bool getChildren( std::vector< CDBTileKey >& children ) const;
87 
89  static int calcDLonZone( double coord_y );
90 
92  static void getTileDimensions( int lod, int lon, int lat, int rref, int uref, double& out_width, double& out_height );
93 
95  static void createRootKeys( const CDBTileCache& tileCache, std::vector< CDBTileKey >& rootKeys );
96 
98  static double getApproximateLodGridSpacing( int lod );
99 
101  osg::BoundingSphere getBounds( const osgEarth::Map* map ) const;
102 
104  bool equals( int lod, int uref, int rref ) const;
105 
107  bool equals( const CDBTileKey& key ) const;
108 
110  size_t getLatLongHash( void ) const;
111 
112  size_t getFullHash( void ) const;
113  size_t getHashNoLod( void ) const;
114 
117  void setCdbTile( CDBTile* tile );
118 
120  CDBTile* cdbTile() const;
121 
122  std::string latString() const;
123  std::string lonString() const;
124  std::string lodString() const;
125  std::string uRefString() const;
126  std::string rRefString() const;
127  protected:
128 
130  int myLod;
131 
133  int myURef;
134 
136  int myRRef;
137 
139  int myLon;
140 
142  int myLat;
143 
145  osgEarth::GeoExtent myExtent;
146 
148  std::string myLatStr;
149  std::string myLonStr;
150  std::string myURefStr;
151  std::string myRRefStr;
152  std::string myLodStr;
153  };
154 
156  std::ostream& operator<<( std::ostream& os, const CDBTileKey& key );
157 
160  {
161  size_t operator()( const makVrv::oe::CDB::CDBTileKey& tileKey ) const
162  {
163  return tileKey.getLatLongHash();
164  }
165  };
166 
169  {
171  {
172  return lhs.getLatLongHash() == rhs.getLatLongHash();
173  }
174  };
175 
178  {
179  size_t operator()( const makVrv::oe::CDB::CDBTileKey& tileKey ) const
180  {
181  return tileKey.getFullHash();
182  }
183  };
184 
187  {
189  {
190  if( lhs.getLat() != rhs.getLat() ) return false;
191  if( lhs.getLon() != rhs.getLon() ) return false;
192  if( lhs.getLOD() != rhs.getLOD() ) return false;
193  if( lhs.getURef() != rhs.getURef() ) return false;
194  if( lhs.getRRef() != rhs.getRRef() ) return false;
195  return true;
196  }
197  };
198  }
199  }
200 }// namespace makVrv::oe::CDB
CDBTile * myCdbTile
Definition: DtCDBTileKey.h:147
Tile Key equal operation.
Definition: DtCDBTileKey.h:186
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:47
functions class that help find CDB tiles information
Definition: DtCDBTileKey.h:37
size_t operator()(const makVrv::oe::CDB::CDBTileKey &tileKey) const
Definition: DtCDBTileKey.h:179
#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:145
int myLod
Tile Level Of Detail.
Definition: DtCDBTileKey.h:130
Latitude Longitude equal operation.
Definition: DtCDBTileKey.h:168
bool operator()(const makVrv::oe::CDB::CDBTileKey &lhs, const makVrv::oe::CDB::CDBTileKey &rhs) const
Definition: DtCDBTileKey.h:188
std::string myRRefStr
Definition: DtCDBTileKey.h:151
std::string myLonStr
Definition: DtCDBTileKey.h:149
Class used to find CDB Tiles information.
Definition: DtCDBTile.h:55
int myLon
Tile Longitude.
Definition: DtCDBTileKey.h:139
std::ostream & operator<<(std::ostream &os, const CDBTileKey &key)
Output the CDB Tile Key stream representation.
Latitude Longitude hash key.
Definition: DtCDBTileKey.h:159
int myLat
Tile Latitude.
Definition: DtCDBTileKey.h:142
Definition: DtCDBTileKey.h:39
Definition: DtCDBTileKey.h:40
int myRRef
Tile Right index Reference.
Definition: DtCDBTileKey.h:136
int getLat() const
Get the lat coordinate of this CDBTileKey.
std::string myLatStr
Definition: DtCDBTileKey.h:148
Definition: DtCDBTileKey.h:36
int myURef
Tile Upper index Reference.
Definition: DtCDBTileKey.h:133
Quadrant
Definition: DtCDBTileKey.h:33
bool operator()(const makVrv::oe::CDB::CDBTileKey &lhs, const makVrv::oe::CDB::CDBTileKey &rhs) const
Definition: DtCDBTileKey.h:170
Complete tile key hash.
Definition: DtCDBTileKey.h:177
int getLOD() const
Get the level of detail for this CDBTileKey.
Utility class to pass CDB lat/lon/ured/rref) values.
Definition: DtCDBTileVerbose.h:17
Definition: DtCDBTileKey.h:35
Definition: DtCDBTileKey.h:38
size_t operator()(const makVrv::oe::CDB::CDBTileKey &tileKey) const
Definition: DtCDBTileKey.h:161
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:150
int getLon() const
Get the lon coordinate of this CDBTileKey.
std::string myLodStr
Definition: DtCDBTileKey.h:152
int getRRef() const
Get the right direction index this CDBTileKey.

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)