VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtCDBTileSource.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2024 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 #pragma once
10 
11 #include "DtCDBOptions.h"
12 #include <osgEarth/TileSource>
13 #include <osgEarth/ImageMosaic>
14 #include <osgEarth/Color>
20 #include <Cee_CdbDB.h>
21 #include <set>
22 #include <map>
23 #include <string>
24 
25 namespace makVrv
26 {
27  class DtDe;
28 }
29 
30 namespace makVrv { namespace oe { namespace CDB
31 {
32  using namespace osgEarth;
33 
34  class DtCDBBaseMaterialTable;
35 
36 
40  class CdbImageMosaic : public ImageMosaic
41  {
42  public:
44  virtual ~CdbImageMosaic() {};
45 
46  virtual osg::Image* createImage(bool isRasterMaterial, bool isMcod);
47  };
48 
53  class CDBTileSource : public TileSource
54  {
55  public:
56 
58  CDBTileSource(const TileSourceOptions& options);
59 
61  Status initialize(const osgDB::Options* dbOptions);
62 
64  osg::Image* createImage(const TileKey& key, ProgressCallback* progress);
65 
67  osg::HeightField* createHeightField(const TileKey& key, ProgressCallback* progress);
68 
69  protected:
70 
72  virtual ~CDBTileSource();
73 
74  private:
75 
77  void processCDBImageryTileSource(const TileKey& key, const std::string& CdbTile, const int st, const TileKey& cdbKey, const std::vector<TileKey>::iterator& k, CdbImageMosaic& mosaic, bool& foundAtLeastOneRealTile, bool& addedImage);
78 
80  void processCDBRasterMaterialTileSource(const TileKey& key, const std::string& CdbTile, const std::string& CdbMaterialDescriptorTile, const int st, const TileKey& cdbKey, const std::vector<TileKey>::iterator& k, CdbImageMosaic& mosaic, bool& foundAtLeastOneRealTile, bool& addedImage);
81 
83  ReadResult readImage(const std::string& cdbfile);
84 
86  osg::ref_ptr<osg::HeightField> readElevation(const std::string& cdbfile);
87 
89  bool convertToMCOD(osg::Image* rasterImage, osg::Image* mcodImage, const std::string& CdbMaterialDescriptorTile);
90 
92  bool convertToSplat( osg::Image* rasterImage, const std::string& CdbMaterialDescriptorTile);
94  std::set<unsigned char> myCompMaterialNotFound;
95 
97  osg::Image* createEmptyMcodImage(osg::Image* rasterImage);
98 
101 
104 
106  std::string myCdbRootDir;
107 
110 
113 
116 
119 
122 
125 
127  bool myMcod;
128 
130  unsigned int myNumberOfMcodLayer;
131 
134 
137 
140 
143 
146 
149  };
150 
151 } } } // namespace mak::osgEarth::CDB
CDB raster earth file options for &quot;cdbraster&quot; driver.
bool myMcod
Flag to know if Raster material will produce MCOD (SensorFx) image.
Definition: DtCDBTileSource.h:127
std::string myCdbRootDir
CDB root folder from the .earth file.
Definition: DtCDBTileSource.h:106
std::set< unsigned char > myCompMaterialNotFound
keep the warning message list so we don&#39;t flood the console
Definition: DtCDBTileSource.h:94
OpenThreads::Mutex myImageryMutex
Whole cache mutex object to allow thread safety.
Definition: DtCDBTileSource.h:133
CDB Class that hold the Dataset informationNote: A DUPLICATED class also exist in the Openflight Plug...
Utility class for Material Classification on Demand (MCOD) for CDB raster/model dataset.
Definition: featureContext.h:36
Class the parse CDB folder before loading it to speed up the actual reading later.
Utility class to get CDB dataset information.
osg::ref_ptr< DtCDBBaseMaterialTable > myProceduralBaseMaterialTable
Base Material table use to map Procedural class index.
Definition: DtCDBTileSource.h:142
osg::ref_ptr< osgDB::Options > myDbOptions
Reference pointer to the OSG DB options.
Definition: DtCDBTileSource.h:103
virtual ~CdbImageMosaic()
Definition: DtCDBTileSource.h:44
Class used to find CDB Tiles information.
Definition: DtCDBTile.h:52
std::map< std::string, color2DArray > mcodColorMap
Definition: DtCDBMcod.h:28
CDB Dataset information class.
Definition: DtCDBDatasetInfo.h:23
IMGUI_API void Image(ImTextureID user_texture_id, const ImVec2 &size, const ImVec2 &uv0=ImVec2(0, 0), const ImVec2 &uv1=ImVec2(1, 1), const ImVec4 &tint_col=ImVec4(1, 1, 1, 1), const ImVec4 &border_col=ImVec4(0, 0, 0, 0))
OpenThreads::Mutex Mutex
Definition: DtOsgThreadingUtils.h:12
CDBDatasets * myDatasetsPtr
Dataset Manager singleton.
Definition: DtCDBTileSource.h:118
Class used to create OSG Tiles from CDB Tiles Used to create OSG imagery, land use or elevation tiles...
Definition: DtCDBTileSource.h:53
Used to pass option(s) Pass option from the OSG earth file to this &quot;cdbraster&quot; driver.
Definition: DtCDBOptions.h:22
CdbDB myCdbDatabase
CDB database object.
Definition: DtCDBTileSource.h:121
CdbImageMosaic()
Definition: DtCDBTileSource.h:43
functions class that help find CDB tiles information
bool myCdbIsOpened
Was the CDB database open correctly.
Definition: DtCDBTileSource.h:124
OpenThreads::Mutex myRasterMaterialMutex
Whole cache mutex object to allow thread safety.
Definition: DtCDBTileSource.h:139
CDBTile * myCdbTilePtr
CDB Tile utility object.
Definition: DtCDBTileSource.h:115
makVrv::DtDe * myDe
Get the DtDe in running from front end plugin.
Definition: DtCDBTileSource.h:148
makVrv::oe::CDB::mcodColorMap myMCODTerrainColorMap
ColorMap for MCOD material.
Definition: DtCDBTileSource.h:145
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
Utility class for extracting a single image from a collection of image tiles.
Definition: DtCDBTileSource.h:40
DatasetInfo myCurrentDataset
Current CDB Dataset of this pager.
Definition: DtCDBTileSource.h:109
OpenThreads::Mutex myElevationMutex
Mutex object to allow thread safety.
Definition: DtCDBTileSource.h:136
osg::ref_ptr< CDBTileCache > myTileCache
CDB Tile cache object.
Definition: DtCDBTileSource.h:112
CDB Dataset class. Hold Dataset information Helper class to retreive CBD Dataset information.
Definition: DtCDBDatasets.h:78
unsigned int myNumberOfMcodLayer
Number of MCOD layer to produce by Raster material (usually 2)
Definition: DtCDBTileSource.h:130
const CDBOptions myCdbOptions
Earth file CDB options.
Definition: DtCDBTileSource.h:100

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)