VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtCDBVectorModel.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright(c) 2026 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 #pragma once
10 
11 #include <osgEarth/Map>
12 #include <osgEarth/Progress>
13 #include <osgEarth/MapNodeObserver>
14 
16 
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 { namespace CDB {
43 
44  class DatasetInfo;
45  class CDBTileKey;
46  class CDBTileVerbose;
47  class CDBModelOptions;
48  class CdbGroupNode;
49  class CDBDatasets;
50  class DtCDBClassIndex;
51  class DtCDBInstanceIndex;
52  class DtCdbGroupNodeProgress;
53 
57  {
58  public:
60  DtCDBVectorModel(const DatasetInfo& CurrentDataset, osg::ref_ptr<DtCDBDatabase> cdbDb, const osgDB::Options* dbOptions, const CDBModelOptions* cdbModelOptions, DtDe& de);
63 
65  bool getModelPoint(const VectFeature* feature, osg::Vec3d& modelPoint);
66 
68  void setMapNode( osgEarth::MapNode* mapNode );
69 
72 
74  virtual void finishTileLoad(CdbGroupNode* groupNode) { ; }
75 
78  virtual void optimizeNodeGraphStateSharing(CdbGroupNode* groupNode);
79 
81  virtual void finishLoadingIndirect(DtIndirectGeometry * indirectGeometry);
82 
86  virtual bool performFeatureInitializationWithPriority() const;
87 
91 
93  virtual bool getMCOD() const { return myMCOD; }
94 
96  void setDatasetCachePath( const std::string& cachePath );
97 
100  void setMaxElevationLod( int maxElevationLod );
101 
105  const RenderingMethod renderingMethod() const;
107 
111  virtual void mapIsolatedNodeToParentNode( osg::ref_ptr<CdbGroupNode> isolatedTempNode,
112  osg::ref_ptr<CdbGroupNode> parentNode );
113 
117  virtual void mergeGroupNodeIntoLiveScenegraph( osg::ref_ptr<CdbGroupNode> isolatedTempNode, int priority );
118  protected:
119 
124  virtual std::string createMCODTableString(const std::map<std::string, color2DArray>& baseMaterialMap);
125 
128  double elevationSamplingResolution( const CDBTileKey& key ) const;
129 
131  osg::observer_ptr<osgEarth::MapNode> myMapNode;
132 
134  osg::observer_ptr<osgEarth::ElevationPool> myElevationPool;
135 
137  osgEarth::ElevationPool::WorkingSet* myElevationPoolWorkingSet;
138 
140  std::string myDatasetCachePath;
141 
144 
149 
152 
153  const bool myEnableIntersections = true;
154 
155  const float myModelScaling = 1.0f;
156 
157  // Color Map to transform CDB Raster Material to MCOD color
159 
162 
165  bool myMCOD;
166 
167  osg::observer_ptr<makVrv::DtOsgGraphMergeOperation> myMergeOperation;
168 
170  {
171  size_t hash( const osg::ref_ptr<CdbGroupNode>& key ) const
172  {
173  return std::hash<const CdbGroupNode*>()(key.get());
174  }
175  bool equal( const osg::ref_ptr<CdbGroupNode >& lhs, const osg::ref_ptr<CdbGroupNode>& rhs ) const
176  {
177  return lhs.get() == rhs.get();
178  }
179  };
180 
182  tbb::concurrent_hash_map< osg::ref_ptr<CdbGroupNode>, osg::ref_ptr<CdbGroupNode>, GroupPtrHash>;
184  };
185 }}} // namespace makVrv::oe::CDB
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
CDB Configuration file holding constant definition.
double elevationSamplingResolution(const CDBTileKey &key) const
Resolution (in degrees) to request from the elevation pool when clamping the features of the given ti...
CDB Class that hold the Dataset informationNote: A DUPLICATED class also exist in the Openflight Plug...
virtual void mapIsolatedNodeToParentNode(osg::ref_ptr< CdbGroupNode > isolatedTempNode, osg::ref_ptr< CdbGroupNode > parentNode)
Map a non live group node to a group node that is live in the main scene graph Once the non live grou...
Utility class for Material Classification on Demand (MCOD) for CDB raster/model dataset.
const float myModelScaling
Definition: DtCDBVectorModel.h:155
void setMaxElevationLod(int maxElevationLod)
The maximum LOD of the CDB elevation dataset (-10 when unknown). Used to pick the elevation sampling ...
bool myMCOD
flag to check if we want to enable MCOD for this dataset will be turn on if we have a mcod color map ...
Definition: DtCDBVectorModel.h:165
Definition: featureContext.h:36
Abstract class to manage vector information.
osg::ref_ptr< DtCDBBaseMaterialTable > myProceduralBaseMaterialTable
Base Material table use to map Procedural class index.
Definition: DtCDBVectorModel.h:161
Indirect geometry can have multiple models and their corresponding ids registered in it...
Definition: DtIndirectGeometryRegistrar.h:111
virtual void optimizeNodeGraphStateSharing(CdbGroupNode *groupNode)
Runs an optimization step for the given node for state sharing. This should be called after loading b...
virtual void finishTileLoad(CdbGroupNode *groupNode)
Finish loading the tile, implemented in derived classes, but not in Lightpoint.
Definition: DtCDBVectorModel.h:74
CDBSigSizeTable mySigSizeTable
Significant Size table for the current dataset.
Definition: DtCDBVectorModel.h:148
osg::observer_ptr< osgEarth::ElevationPool > myElevationPool
observer pointer to the elevation pool on the map node
Definition: DtCDBVectorModel.h:134
RenderingMethod myRenderingMethod
Vector rendering method.
Definition: DtCDBVectorModel.h:151
CDB osg node class CdbGroupNode as the following structure for GT models Each quadrant does not have ...
Definition: DtCDBGroupNode.h:49
const bool myEnableIntersections
Definition: DtCDBVectorModel.h:153
bool getModelPoint(const VectFeature *feature, osg::Vec3d &modelPoint)
Get the vector point.
RenderingMethod
Rendering enum method.
Definition: DtRenderingMethod.h:14
Utility class to manage CDB Base Material Table.
virtual bool performFeatureInitializationWithPriority() const
Whether or not feature initialization should be performed with priority based on LOD This function al...
std::map< std::string, color2DArray > mcodColorMap
Definition: DtCDBMcod.h:28
osg::ref_ptr< osgDB::Options > & getDbOptions()
needed by async loaders
Definition: DtCDBVectorModel.h:90
This class inherits from.
Definition: DtIndirectGeometry.h:122
CDB Dataset information class.
Definition: DtCDBDatasetInfo.h:24
std::string myDatasetCachePath
The cache path for the data set.
Definition: DtCDBVectorModel.h:140
RenderingMethod renderingMethod()
Get the rendering method.
int myMaxElevationLod
Maximum LOD of the CDB elevation dataset (-10 when unknown)
Definition: DtCDBVectorModel.h:143
Definition: DtCDBVectorModel.h:169
void setMapNode(osgEarth::MapNode *mapNode)
The observer map node.
DtCDBVectorModel(const DatasetInfo &CurrentDataset, osg::ref_ptr< DtCDBDatabase > cdbDb, const osgDB::Options *dbOptions, const CDBModelOptions *cdbModelOptions, DtDe &de)
CTOR.
bool equal(const osg::ref_ptr< CdbGroupNode > &lhs, const osg::ref_ptr< CdbGroupNode > &rhs) const
Definition: DtCDBVectorModel.h:175
Used to pass option(s) Used to pass option from the OSG earth file this &quot;cdb&quot; model driver...
Definition: DtCDBModelOptions.h:28
tbb::concurrent_hash_map< osg::ref_ptr< CdbGroupNode >, osg::ref_ptr< CdbGroupNode >, GroupPtrHash > DtIsolatedNodeToLiveNodeMap
Definition: DtCDBVectorModel.h:182
DtIsolatedNodeToLiveNodeMap myIsolatedGroupNodeToLiveGroupNodes
Definition: DtCDBVectorModel.h:183
Abstract Vector handler class.
Definition: DtCDBVectorModel.h:56
Abstract Vector handler class.
Definition: DtCDBVector.h:58
Reference wrapper class for CdbDB.
virtual bool getMCOD() const
do we need MCOD
Definition: DtCDBVectorModel.h:93
virtual std::string createMCODTableString(const std::map< std::string, color2DArray > &baseMaterialMap)
Create an MCOD string table to pass as an option when reading the FLT model. OSG OpenFlight plugin wi...
osg::observer_ptr< osgEarth::MapNode > myMapNode
observer pointer to the plugin map node
Definition: DtCDBVectorModel.h:131
osgEarth::ElevationPool::WorkingSet * myElevationPoolWorkingSet
elevation pool working set
Definition: DtCDBVectorModel.h:137
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.
size_t hash(const osg::ref_ptr< CdbGroupNode > &key) const
Definition: DtCDBVectorModel.h:171
makVrv::oe::CDB::mcodColorMap myMCODTerrainColorMap
Definition: DtCDBVectorModel.h:158
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< osgDB::Options > myDbOptions
Database option.
Definition: DtCDBVector.h:144
Abstract class to manage Cdb class vector row (dbf) information.
void setDatasetCachePath(const std::string &cachePath)
The cache path for the data set.
virtual void mergeGroupNodeIntoLiveScenegraph(osg::ref_ptr< CdbGroupNode > isolatedTempNode, int priority)
Merge an isolated graph group node into the live scene graph, looks up the live group node in myIsola...
virtual void finishLoadingIndirect(DtIndirectGeometry *indirectGeometry)
forces the pager to wait till tile is really ready, shared code that useful for derived classes ...
const CDBModelOptions * myCdbModelOptions
CDB option class.
Definition: DtCDBVectorModel.h:146
osg::observer_ptr< makVrv::DtOsgGraphMergeOperation > myMergeOperation
Definition: DtCDBVectorModel.h:167
virtual DtIndirectGeometryRegistrar * indirectGeometryRegistrar()
access to indirect classes
Definition: DtCDBVectorModel.h:71
Hold all the Significant size information of one dataset.
Definition: DtCDBSigSizeTable.h:20

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)