VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtCDBFeatureSource.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2026 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
10 #pragma once
11 
13 #include <osgEarth/FeatureSource>
16 
17 namespace makVrv {
18 
19  class DtDe;
20 
21  namespace oe {
22  namespace CDB
23  {
24  class CDBTile;
25  class CDBTileCache;
26  class DtCDBDatabase;
27  class DatasetInfo;
28  class DtCDBVectorFeature;
29  }
30  }
31 }
32 
33 namespace osgEarth
34 {
39  {
40  public:
41  class DT_DLL_OSGEARTH_CDB_UTILS Options : public TiledFeatureSource::Options {
42  public:
43  META_LayerOptions(osgEarth, Options, TiledFeatureSource::Options);
44  OE_OPTION(int, dataset, 0);
45  OE_OPTION(int, componentSelector1, 0);
46  OE_OPTION(int, componentSelector2, 0);
47  OE_OPTION(std::string, cdbRoot);
48  OE_OPTION(std::string, makVrfLayer);
49  virtual Config getConfig() const;
50  private:
51  void fromConfig(const Config& conf);
52  };
53 
54  public:
55  META_Layer(osgEarth, CDBFeatureSource, Options, TiledFeatureSource, cdbfeatures);
56 
58  void setDataset(const int& value);
59  const int& getDataset() const;
60 
62  void setComponentSelector1(const int& value);
63  const int& getComponentSelector1() const;
64 
66  void setComponentSelector2(const int& value);
67  const int& getComponentSelector2() const;
68 
70  void setCdbRoot(const std::string& value);
71  const std::string& getCdbRoot() const;
72 
74  void setMakVrfLayer(const std::string& value);
75  const std::string& getMakVrfLayer() const;
76 
78  Status insert(const TileKey& key, const FeatureList& features, bool overwrite) override;
79 
80  public: // Layer
81 
83  Status openImplementation() override;
84 
85  protected:
86 
88  void init() override;
89 
91  FeatureCursor* createFeatureCursorImplementation(const Query& query, ProgressCallback* progress) const override;
92 
94  int getCDBMaxLOD();
95 
97  void readFeatureFromCache(const osgEarth::optional<osgEarth::TileKey>& osgEarthTileKey, FeatureList& currentCdbTileFeatures, FeatureList& osgEarthFeatures) const;
98 
99  public: // FeatureSource
100 
101  bool isWritable() const override;
102 
103  protected:
104 
105  virtual ~CDBFeatureSource() {}
106 
108  bool isFeatureDatasetSupported();
109 
111  bool openCDBDatabase();
112 
114  void readCDBDatasetInfo(osgEarth::GeoExtent& cdbGeoExtent);
115 
117  void readCDBTilesToCache(ProgressCallback* progress) const;
118 
120  void getCDBTilesForOsgEarthTileKey(const osgEarth::optional<osgEarth::TileKey>& osgEarthTileKey, makVrv::oe::CDB::DtCDBUtils::CdbTileOrderedSet& cdbTiles) const;
121 
123  void readFeaturesFromCDBTiles(const osgEarth::optional<osgEarth::TileKey>& osgEarthTileKey, const makVrv::oe::CDB::DtCDBUtils::CdbTileOrderedSet& cdbTiles, FeatureList& osgEarthFeatures, ProgressCallback* progress) const;
124 
126  bool fileInCache(const std::string shpInstanceFile, FeatureList& currentCdbTileFeatures) const;
127 
128  private:
129 
131  void debugPrintCacheFeatures(const osgEarth::optional<osgEarth::TileKey>& osgEarthTileKey, const FeatureList& currentCdbTileFeatures, const std::string shpInstanceFile) const;
132 
134  void debugPrintOutputFromCacheFeatures(const osgEarth::optional<osgEarth::TileKey>& osgEarthTileKey, const FeatureList& osgEarthFeatures, const std::string shpInstanceFile) const;
135 
136 
139 
142 
145 
148 
151 
155 
160 
163 
167 
170 
173 
176 
179  };
180 } // namespace osgEarth
181 
osgEarth::Threading::Mutex myMutex
Mutex object to allow thread safety.
Definition: DtCDBFeatureSource.h:169
makVrv::oe::CDB::CDBTile * myCdbTilePtr
CDB Tile utility object.
Definition: DtCDBFeatureSource.h:144
osg::ref_ptr< makVrv::oe::CDB::DtCDBDatabase > myCdbDatabase
CDB database object.
Definition: DtCDBFeatureSource.h:138
CDB Class that hold the Dataset informationNote: A DUPLICATED class also exist in the Openflight Plug...
Definition: DtCDBFeatureSource.h:41
#define DT_DLL_OSGEARTH_CDB_UTILS
Definition: DtCDBExport.h:18
FeatureSource that reads feature tiles from a parameterized &quot;CDB&quot; source.
Definition: DtCDBFeatureSource.h:38
std::map< std::string, osgEarth::FeatureList > CacheVectorDataMap
Definition: DtCDBUtils.h:25
makVrv::DtDe * myDe
Pointer to DtDe object.
Definition: DtCDBFeatureSource.h:162
std::set< std::string, CdbTileFilenameComparator > CdbTileOrderedSet
Definition: DtCDBUtils.h:131
virtual ~CDBFeatureSource()
Definition: DtCDBFeatureSource.h:105
Class used to find CDB Tiles information.
Definition: DtCDBTile.h:55
Generic utility class.
makVrv::oe::CDB::CacheVectorDataMap myCacheVectorData
Cache vector data to reduce re-read of the same vector files and conversion to features We want to ca...
Definition: DtCDBFeatureSource.h:166
osg::ref_ptr< makVrv::oe::CDB::DtCDBVectorFeature > myVector
pointer to manage different types of vector feature object Vrv This will be used for reading/clipping...
Definition: DtCDBFeatureSource.h:154
makVrv::oe::CDB::DatasetInfo myDatasetInfo
Current CDB Dataset information.
Definition: DtCDBFeatureSource.h:141
CDB Dataset information class.
Definition: DtCDBDatasetInfo.h:24
osg::ref_ptr< osgEarth::SpatialReference > myWgs84
Spatial reference pointer geocentric.
Definition: DtCDBFeatureSource.h:150
GeoExtent myCdbDatasetExtent
CDB Dataset GeoExtent.
Definition: DtCDBFeatureSource.h:175
OpenThreads::Mutex Mutex
Definition: DtOsgThreadingUtils.h:12
osg::ref_ptr< makVrv::oe::CDB::CDBTileCache > myTileCache
CDB Tile cache object.
Definition: DtCDBFeatureSource.h:147
OSGEARTH_SPECIALIZE_CONFIG(osgEarth::CDBFeatureSource::Options)
bool myReadCacheFilesDone
Flag to indicate if we already read cache files (LC, LOD0, LOD1) for the whole CDB dataset...
Definition: DtCDBFeatureSource.h:172
DT_DLL_DEBUGDRAWRENDERER void init(makVrv::DtDe &de)
Work function for the plugin initialization.
bool myFoundDataForDataset
Flag to indicate if there is no data for this dataset.
Definition: DtCDBFeatureSource.h:178
The DtDe is the core component of any VR-Vantage application. It owns a DtRenderer, DtDeCommunicator, as well as a DtDisplay and other things.
Definition: DtDe.h:76
osg::ref_ptr< makVrv::oe::CDB::DtCDBVectorFeature > myCacheVector
pointer to manage different types of vector feature object Vrv This one will only be used for LC/LOD0...
Definition: DtCDBFeatureSource.h:159

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)