VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtCDBVector.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright(c) 2025 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 #pragma once
10 
12 #include <osgEarth/Map>
13 #include <osgEarth/Progress>
14 #include <osgEarth/MapNodeObserver>
15 
17 
25 
26 #include <tbb/concurrent_hash_map.h>
27 
28 #include <Vect/Cee_VectFeature.h>
29 #include <Cee_CdbDB.h>
30 
31 namespace osgEarth
32 {
33  class SpatialReference;
34 }
35 
36 namespace makVrv
37 {
38  class DtIndirectGeometryRegistrar;
39  class DtIndirectGeometry;
40  class DtOsgGraphMergeOperation;
41 
42  namespace oe {
43  namespace CDB {
44 
45  class DatasetInfo;
46  class CDBTileKey;
47  class CDBTileVerbose;
48  class CDBModelOptions;
49  class CdbGroupNode;
50  class CDBDatasets;
51  class DtCDBClassIndex;
52  class DtCDBInstanceIndex;
53  class DtCdbGroupNodeProgress;
54 
55 
58  class DT_DLL_OSGEARTH_CDB_UTILS DtCDBVector : public osg::Referenced
59  {
60  public:
62  DtCDBVector(const DatasetInfo& CurrentDataset, osg::ref_ptr<DtCDBDatabase> cdbDb, const osgDB::Options* dbOptions, DtDe& de);
64  ~DtCDBVector();
65 
67  virtual void initialize(const std::string& shpInstanceFile, DtCDBInstanceIndex& instanceAttrIndexes,
68  const std::string& dbfClassFile, DtCDBClassIndex& classAttrIndexes,
69  const std::string& dbfExtendedFile) = 0;
71  virtual bool isInitialized() const { return myIsInitialized; };
72 
74  virtual void readInstance(const std::string& dbfClassFile, DtCDBInstanceIndex& instanceAttrIndexes, const CDBTileKey& key,
75  const std::string& shpInstanceFile, VectFile* shpVector, VecInstancesDbfRow& vecInstanceRow, const MapStringToClassDbfRow& classMap) = 0;
76 
78  virtual void readClass(const std::string& dbfClassFile, DtCDBClassIndex& classAttrIndexes, const CDBTileKey& key, MapStringToClassDbfRow& classMap) = 0;
79 
81  virtual void processFeature(const std::string& dbfClassFile, const CDBTileKey& key, CdbGroupNode* groupNode, VecInstancesDbfRow& vecInstanceRow,
82  DtCdbGroupNodeProgress* progress, bool& wasModelFound) = 0;
83 
84 
85  protected:
86 
87  // Thread-safe "warn once" registry keyed by arbitrary strings.
89  void warn_once(const std::string& classname, const std::string& key, const std::string& message)
90  {
91  std::lock_guard<Threading::Mutex> lock(mutex_);
92  auto it = keys_.find(key);
93  if (it == keys_.end()) {
94  OE_WARN << classname << " " << message << " (this message will appear only once)" << std::endl;
95  keys_.insert(key);
96  }
97  }
98 
99  void warn_once_missingfield(const std::string& classname, const std::string& key, const std::string& field, const std::string& file)
100  {
101  std::lock_guard<Threading::Mutex> lock(mutex_);
102  auto it = keys_.find(key);
103  if (it == keys_.end()) {
104  OE_WARN << classname << " Unable to find [" << field << "] field in file: " << file << " (this message will appear only once)" << std::endl;
105  keys_.insert(key);
106  }
107  }
108 
109  private:
111  std::unordered_set<std::string> keys_;
112  };
113 
114  // Single instance for this translation unit.
116  {
117  static WarnOnceRegistry reg;
118  return reg;
119  }
120 
122 
125 
128 
134  //std::string myDatasetCachePath;
136  std::string myShpInstanceFile;
138  std::string myDbfClassFile;
140  std::string myDbfExtendedFile;
146  std::string myCDBRootPath;
148  std::string myFACC;
150  std::string myFSC;
152  std::string myCNAM;
154  unsigned int myCMIX;
155 
157  //int myClassIndexCNAM;
159  //int myClassIndexFACC;
161  //int myClassIndexFSC;
163  //int myClassIndexCMIX;
164 
167 
170 
175 
178  };
179 
180  }
181  }
182 }
std::string myDbfClassFile
Dbf class filename.
Definition: DtCDBVector.h:138
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
WarnOnceRegistry & getWarnOnceRegistry()
Definition: DtCDBVector.h:115
CDB Configuration file holding constant definition.
bool myIsLinearDataset
Is linear dataset.
Definition: DtCDBVector.h:172
CDB Class that hold the Dataset informationNote: A DUPLICATED class also exist in the Openflight Plug...
std::unordered_set< std::string > keys_
Definition: DtCDBVector.h:111
DatasetInfo myCurrentDataset
Dataset information.
Definition: DtCDBVector.h:132
void warn_once_missingfield(const std::string &classname, const std::string &key, const std::string &field, const std::string &file)
Definition: DtCDBVector.h:99
Utility class for Material Classification on Demand (MCOD) for CDB raster/model dataset.
#define DT_DLL_OSGEARTH_CDB_UTILS
Definition: DtCDBExport.h:18
Definition: featureContext.h:36
bool myIsInitialized
Was the indexes read.
Definition: DtCDBVector.h:124
std::string myDbfExtendedFile
Dbf extented attributes filename.
Definition: DtCDBVector.h:140
bool myIsArealDataset
Is areal dataset.
Definition: DtCDBVector.h:174
CDB osg node class CdbGroupNode as the following structure for GT models Each quadrant does not have ...
Definition: DtCDBGroupNode.h:49
Class used to keep &quot;instance&quot; indexes attributes dbf information.
Definition: DtCDBAttributeIndex.h:111
Threading::Mutex mutex_
Definition: DtCDBVector.h:110
std::vector< osg::ref_ptr< DtCDBinstanceRow > > VecInstancesDbfRow
Definition: DtCDBClassRow.h:88
static const DtCDBDbfConfig myVectorConfig
Static class with predefine information.
Definition: DtCDBVector.h:127
Utility class to manage CDB Base Material Table.
CDB Dataset information class.
Definition: DtCDBDatasetInfo.h:24
The DtCdbGroupNodeProgressthat gets passed to createPagedNode() to use. It will report cancellation i...
Definition: DtCDBUtils.h:209
std::string myCNAM
Class Name field value (common attributes)
Definition: DtCDBVector.h:152
OpenThreads::Mutex Mutex
Definition: DtOsgThreadingUtils.h:12
CDBDatasets * myCDBDatasets
CDB Dataset information manager.
Definition: DtCDBVector.h:166
std::string myCDBRootPath
Copy of CDB root path.
Definition: DtCDBVector.h:146
Abstract Vector handler class.
Definition: DtCDBVector.h:58
Reference wrapper class for CdbDB.
std::string myShpInstanceFile
The cache path for the data set.
Definition: DtCDBVector.h:136
unsigned int myCMIX
Composite Material Index field value (common attributes)
Definition: DtCDBVector.h:154
osg::ref_ptr< DtCDBDatabase > myCdbDatabase
Valid CDB database pointer.
Definition: DtCDBVector.h:142
WarnOnceRegistry & myWarnOnceRegistry
Definition: DtCDBVector.h:121
std::unordered_map< std::string, osg::ref_ptr< DtCDBClassRow > > MapStringToClassDbfRow
Definition: DtCDBClassRow.h:52
CDB Significant Size Table class (to be filled from ../appData/cdb/SignificantSize_SwitchDistance.xml) Note: A DUPLICATED class also exist in the Openflight Plugin of MakOSG and this one in Vantage osgdb_osgearth_model_cdb TODO REMOVE THIS ONE AND REFERENCE THE MakOsg FLT one once we MERGE IN THE TRUNK.
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
void warn_once(const std::string &classname, const std::string &key, const std::string &message)
Definition: DtCDBVector.h:89
osg::ref_ptr< osgDB::Options > myDbOptions
Database option.
Definition: DtCDBVector.h:144
Abstract class to manage Cdb class vector row (dbf) information.
int myTileLod
keep a copy of the current tile CDB LOD
Definition: DtCDBVector.h:169
osg::ref_ptr< osgEarth::SpatialReference > myWgs84
Spatial reference pointer geocentric.
Definition: DtCDBVector.h:130
Class used to keep &quot;class&quot; indexes attributes index dbf information.
Definition: DtCDBAttributeIndex.h:22
CDB Dataset class. Hold Dataset information Helper class to retreive CBD Dataset information.
Definition: DtCDBDatasets.h:78
virtual bool isInitialized() const
Check if initialize() was called.
Definition: DtCDBVector.h:71
DtDe & myDe
Reference to DtDe.
Definition: DtCDBVector.h:177
CDB class that hold definition (like DBF column name, config file, etc)Renamed DtCDBDbfConfig from Dt...
Definition: DtCDBDbfConfig.h:20
std::string myFACC
Feature Attribute Classification Code field value (common attributes)
Definition: DtCDBVector.h:148
std::string myFSC
FACC Sub Code field value (common attributes)
Definition: DtCDBVector.h:150

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)