VR-Forces 4.8 Class Documentation
 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) 2019 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 
19 
23 #include <Vect/Cee_VectFeature.h>
24 #include <Cee_CdbDB.h>
25 #include <vrvUtil/DtProfiler.h>
26 
27 #include <boost/thread/condition_variable.hpp>
28 #include <tbb/atomic.h>
29 
30 namespace makVrv {
31  class DtIndirectGeometryRegistrar;
32  class DtIndirectGeometry;
33  namespace oe {
34  namespace CDB
35 {
36  class DatasetInfo;
37  class CDBTileKey;
38  class CDBTileVerbose;
39  class CDBModelOptions;
40  class CdbGroupNode;
41  class CDBDatasets;
42 
43  #define theINDEXNOTINITIALIZED -1
44 
47  class DtCDBVector : public osg::Referenced
48  {
49  public:
51  DtCDBVector(const DatasetInfo& CurrentDataset, osg::ref_ptr<DtCDBDatabase> cdbDb, const osgDB::Options* dbOptions, const CDBModelOptions* cdbModelOptions, DtDe& de);
53  ~DtCDBVector();
54 
56  virtual void initialize(const std::string& shpInstanceFile, const std::string& dbfClassFile, const std::string& dbfExtendedFile) = 0;
58  virtual bool isInitialized() const { return myIsInitialized; };
60  virtual void readInstance(const std::string& dbfClassFile, const CDBTileKey& key, const std::string& shpInstanceFile, VectFile* shpVector,
61  const osgEarth::Util::ElevationQuery& elevationQuery, VecInstancesDbfRow& vecInstanceRow, const CDBTileVerbose& verboseKey,
62  const MapStringToClassDbfRow& classMap, const std::string* datasetCachePath = NULL) = 0;
64  virtual void readClass(const std::string& dbfClassFile, const CDBTileKey& key, const CDBTileVerbose& verboseKey, MapStringToClassDbfRow& classMap) = 0;
66  //virtual void readExtended() = 0;
68  virtual void processFeature(const std::string& dbfClassFile, const CDBTileKey& key, CdbGroupNode* groupNode, VecInstancesDbfRow& vecInstanceRow,
69  osgEarth::ProgressCallback* progress, bool& wasModelFound) = 0;
71  bool getModelPoint(const VectFeature* feature, osg::Vec3d& modelPoint);
73  bool isValidName(std::string &filename) const;
75  void setMapNode(osgEarth::MapNode* mapNode) { myMapNode = mapNode; };
76 
79 
81  virtual void finishTileLoadAndWait(CdbGroupNode* groupNode) { ; }
82 
84  virtual void finishLoadingIndirectAndWait(DtIndirectGeometry * indirectGeometry);
85 
88 
90  virtual void markTaskFinished();
91 
92  protected:
98  osg::observer_ptr<osgEarth::MapNode> myMapNode;
104  std::string myShpInstanceFile;
106  std::string myDbfClassFile;
108  std::string myDbfExtendedFile;
118  std::string myCDBRootPath;
120  std::string myFACC;
122  std::string myFSC;
124  std::string myCNAM;
126  unsigned int myCMIX;
127 
136 
139 
142 
145 
146  static tbb::atomic<int> theTotalNumActiveAsyncTasks;
147  tbb::atomic<int> myActiveAsyncTasks;
148  boost::condition_variable myWaitCondition;
149  boost::mutex myWaitMutex;
150 
152  };
153 }}} // namespace makVrv::oe::CDB
std::string myDbfClassFile
Dbf class filename.
Definition: DtCDBVector.h:106
Hold the unique CDB tile key information CDB LOD goes from -10 to 23.
Definition: DtCDBTileKey.h:28
static const DtCDBPagerConfig myVectorConfig
Static class with predefine information.
Definition: DtCDBVector.h:100
CDBSigSizeTable mySigSizeTable
Significant Size table for the current dataset.
Definition: DtCDBVector.h:116
RenderingMethod myRenderingMethod
Vector rendering method.
Definition: DtCDBVector.h:144
CDB Class that hold the Dataset informationNote: A DUPLICATED class also exist in the Openflight Plug...
DatasetInfo myCurrentDataset
Dataset information.
Definition: DtCDBVector.h:102
Definition: featureContext.h:37
Indirect geometry can have multiple models and their corresponding ids registered in it...
Definition: DtIndirectGeometryRegistrar.h:101
boost::condition_variable myWaitCondition
Definition: DtCDBVector.h:148
bool myIsInitialized
Was the indexes read.
Definition: DtCDBVector.h:94
std::string myDbfExtendedFile
Dbf extented attributes filename.
Definition: DtCDBVector.h:108
tbb::atomic< int > myActiveAsyncTasks
Definition: DtCDBVector.h:147
CDB osg node class CdbGroupNode as the following structure for GT models Each quadrant does not have ...
Definition: DtCDBGroupNode.h:59
virtual void readClass(const std::string &dbfClassFile, const CDBTileKey &key, const CDBTileVerbose &verboseKey, MapStringToClassDbfRow &classMap)=0
Read class dbf indexes and information.
CDB class that hold definition (like DBF column name, config file, etc)
Definition: DtCDBPagerConfig.h:18
osg::ref_ptr< osgDB::Options > & getDbOptions()
needed by async loaders
Definition: DtCDBVector.h:87
RenderingMethod
Rendering enum method.
Definition: DtRenderingMethod.h:14
virtual void readInstance(const std::string &dbfClassFile, const CDBTileKey &key, const std::string &shpInstanceFile, VectFile *shpVector, const osgEarth::Util::ElevationQuery &elevationQuery, VecInstancesDbfRow &vecInstanceRow, const CDBTileVerbose &verboseKey, const MapStringToClassDbfRow &classMap, const std::string *datasetCachePath=NULL)=0
Read instance dbf indexes and information.
int myClassIndexFSC
(Class) FACC Sub Code Column index
Definition: DtCDBVector.h:133
const CDBModelOptions * myCdbModelOptions
CDB option class.
Definition: DtCDBVector.h:112
bool isValidName(std::string &filename) const
Check if a cdb filename is valid.
This class inherits from osg::Drawable, which allows us to hook into our indirect engine to render us...
Definition: DtIndirectGeometry.h:69
boost::mutex myWaitMutex
Definition: DtCDBVector.h:149
CDB Dataset information class.
Definition: DtCDBDatasetInfo.h:23
virtual DtIndirectGeometryRegistrar * indirectGeometryRegistrar()
access to indirect classes
Definition: DtCDBVector.h:78
void setMapNode(osgEarth::MapNode *mapNode)
The observer map node.
Definition: DtCDBVector.h:75
osg::observer_ptr< osgEarth::MapNode > myMapNode
observer pointer to the plugin map node
Definition: DtCDBVector.h:98
int myClassIndexCNAM
(Class) CNAM Column index
Definition: DtCDBVector.h:129
std::string myCNAM
Class Name field value (common attributes)
Definition: DtCDBVector.h:124
virtual void processFeature(const std::string &dbfClassFile, const CDBTileKey &key, CdbGroupNode *groupNode, VecInstancesDbfRow &vecInstanceRow, osgEarth::ProgressCallback *progress, bool &wasModelFound)=0
Read extended dbf indexes (not yet supported)
CDB Configuration file holding constant definition.
CDBDatasets * myCDBDatasets
CDB Dataset information manager.
Definition: DtCDBVector.h:141
Used to pass option(s) Used to pass option from the OSG earth file this &quot;cdb&quot; model driver...
Definition: DtCDBModelOptions.h:28
Contains the classes allowing the profiler to work, DtProfileManager, DtProfileSample, and DtProfileIterator.
std::string myCDBRootPath
Copy of CDB root path (from myDbOptions)
Definition: DtCDBVector.h:118
Abstract Vector handler class.
Definition: DtCDBVector.h:47
DtCDBVector(const DatasetInfo &CurrentDataset, osg::ref_ptr< DtCDBDatabase > cdbDb, const osgDB::Options *dbOptions, const CDBModelOptions *cdbModelOptions, DtDe &de)
CTOR.
std::string myShpInstanceFile
Dbf instance filename.
Definition: DtCDBVector.h:104
unsigned int myCMIX
Composite Material Index field value (common attributes)
Definition: DtCDBVector.h:126
std::vector< osg::ref_ptr< DtCDBinstanceRow > > VecInstancesDbfRow
Definition: DtCDBClassRow.h:69
virtual void finishLoadingIndirectAndWait(DtIndirectGeometry *indirectGeometry)
forces the pager to wait till tile is really ready, shared code that useful for derived classes ...
int myClassIndexFACC
(Class) Feature Attribute Classification Code Column index
Definition: DtCDBVector.h:131
osg::ref_ptr< DtCDBDatabase > myCdbDatabase
Valid CDB database pointer.
Definition: DtCDBVector.h:110
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.
virtual void initialize(const std::string &shpInstanceFile, const std::string &dbfClassFile, const std::string &dbfExtendedFile)=0
Read the index of the needed fields and set myIsInitialized flag to true.
virtual void finishTileLoadAndWait(CdbGroupNode *groupNode)
forces the pager to wait till tile is really ready, implemented in derived classes, but not in Lightpoint
Definition: DtCDBVector.h:81
The DtDe is the core component of any VR-Vantage application.
Definition: DtDe.h:69
static tbb::atomic< int > theTotalNumActiveAsyncTasks
Definition: DtCDBVector.h:146
Utility class to pass CDB lat/lon/ured/rref) values.
Definition: DtCDBTileVerbose.h:17
bool getModelPoint(const VectFeature *feature, osg::Vec3d &modelPoint)
Get the vector point.
osg::ref_ptr< osgDB::Options > myDbOptions
Database option.
Definition: DtCDBVector.h:114
std::map< std::string, osg::ref_ptr< DtCDBClassRow > > MapStringToClassDbfRow
Definition: DtCDBClassRow.h:31
virtual void markTaskFinished()
called exclusively by async loaders
Abstract class to manage Cdb class vector row (dbf) information.
int myTileLod
keep a copy of the current tile CDB LOD
Definition: DtCDBVector.h:138
osg::ref_ptr< osgEarth::SpatialReference > myWgs84
Spatial reference pointer geocentric.
Definition: DtCDBVector.h:96
CDB Dataset class.
Definition: DtCDBDatasets.h:78
int myClassIndexCMIX
(Class) Composite Material Index Column index
Definition: DtCDBVector.h:135
virtual bool isInitialized() const
Check if initialize() was called.
Definition: DtCDBVector.h:58
DtDe & myDe
Definition: DtCDBVector.h:151
Hold all the Significant size information of one dataset.
Definition: DtCDBSigSizeTable.h:20
std::string myFACC
Feature Attribute Classification Code field value (common attributes)
Definition: DtCDBVector.h:120
std::string myFSC
FACC Sub Code field value (common attributes)
Definition: DtCDBVector.h:122

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)