VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtCDBVectorFeature.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 
16 #include <osg/ref_ptr>
17 #include <osgEarth/Feature>
18 
19 #include <Vect/Cee_VectFeature.h>
20 
21 #define DEBUG_CDB_FEATURE 0
22 
23 namespace osgEarth
24 {
25  class SpatialReference;
26 }
27 
28 namespace makVrv
29 {
30  class DtIndirectGeometryRegistrar;
31  class DtIndirectGeometry;
32  class DtOsgGraphMergeOperation;
33 
34  namespace oe {
35  namespace CDB {
36 
37  class DtCDBDatabase;
38 
42  {
43  public:
45  DtCDBVectorFeature(const DatasetInfo& CurrentDataset, osg::ref_ptr<DtCDBDatabase> cdbDb, const osgDB::Options* dbOptions,
46  const osgEarth::CDBFeatureSource::Options* cdbFeatureSourceOptions, DtDe& de);
49 
51  void setOsgEarthTileKey(const osgEarth::optional<osgEarth::TileKey>& osgEarthTileKey);
52 
54  void setOsgEarthFeaturesList(osgEarth::FeatureList* osgEarthFeatures);
55 
58  void setCurrentCdbTileFeatureList(osgEarth::FeatureList* cdbTileFeatures);
59 
61  void setFeatureListCache(CacheVectorDataMap* cacheVectorData);
62 
64  bool cacheCurrentCdbTileFeatures(const std::string& shpInstanceFile) const;
65 
67  void setCurrentCdbTileKey(const CDBTileKey* cdbKey);
68 
70  const CDBTileKey* getCurrentCdbTileKey() const;
71 
73  void setDatasetInfo(const DatasetInfo& datasetInfo);
74 
76  void getLatLonFromCdbFeature(const VectFeature* cdbFeature, double& latitude, double& longitude) const;
77 
80  void clipLinear();
81 
84  void clipAreal();
85 
87  virtual void cropVectorFeatureGeometry(bool value);
88 
91  virtual osgEarth::Geometry* cropGeometry(const osgEarth::Geometry* geom) const;
92 
93  protected:
94 
95  // \brief Compute outside portion of a geometry relative to a rectangular clip polygon.
96  virtual osgEarth::Geometry* clipArealGeometryOutsideRect(const osgEarth::Geometry* geom, const osgEarth::GeoExtent& extent);
97 
98  // \brief Create linestring osgEarth geometry from CDB feature
99  virtual osg::ref_ptr<osgEarth::Geometry> createLineStringGeometry(const VectFeature* cdbFeature, const std::string& shpInstanceFile, bool crop, bool& oneTimeWarning);
100 
101  // \brief Create polygon osgEarth geometry from CDB feature
102  virtual osg::ref_ptr<osgEarth::Geometry> createPolygonGeometry(const VectFeature* cdbFeature, const std::string& shpInstanceFile, bool crop, bool& oneTimeWarning);
103 
104 
106  bool liangBarskyInsideParams(double x0, double y0, double x1, double y1,
107  double xmin, double ymin, double xmax, double ymax,
108  double& tEnter, double& tExit);
109 
111  osgEarth::Geometry* clipLineStringOutsideExtent(const osgEarth::LineString* line, const osgEarth::GeoExtent& extent);
112 
114  osgEarth::Geometry* clipLinearGeometryOutsideExtent(const osgEarth::Geometry* geom, const osgEarth::GeoExtent& extent);
115 
118 
120  osgEarth::TileKey myOsgEarthTileKey;
121 
123  osgEarth::FeatureList* myOsgEarthFeatures;
124 
126  osgEarth::FeatureList* myCurrentCdbTileFeatures;
127 
130 
133 
136 
137  // \brief Set to true if we want to crop LineString geometries when creating them
139  };
140  }
141  }
142 } // namespace makVrv::oe::CDB
DatasetInfo myDatasetInfo
Current CDB Dataset information.
Definition: DtCDBVectorFeature.h:135
osgEarth::FeatureList * myOsgEarthFeatures
osgEarth features list reference to fill
Definition: DtCDBVectorFeature.h:123
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 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
Definition: featureContext.h:36
osgEarth::TileKey myOsgEarthTileKey
osgEarth tile key for the current request
Definition: DtCDBVectorFeature.h:120
std::map< std::string, osgEarth::FeatureList > CacheVectorDataMap
Definition: DtCDBUtils.h:25
Abstract class to manage vector information.
Class to read CDB Feature Source from the earth file For example it can read the CDB roadNetwork data...
bool myCropGeometry
Definition: DtCDBVectorFeature.h:138
osgEarth::CDBFeatureSource::Options myCdbFeatureSourceOptions
Current CDB feature source information.
Definition: DtCDBVectorFeature.h:117
const CDBTileKey * myCurrentCdbTileKey
Current CDB tile key being processed.
Definition: DtCDBVectorFeature.h:132
CDB Dataset information class.
Definition: DtCDBDatasetInfo.h:24
osgEarth::FeatureList * myCurrentCdbTileFeatures
current CDB tiles features to fill and use in the cache if needed
Definition: DtCDBVectorFeature.h:126
Abstract Vector handler class.
Definition: DtCDBVector.h:58
Reference wrapper class for CdbDB.
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
CDB Tile key structure for the model pager.
CacheVectorDataMap * myCacheVectorData
Cache vector data to reduce re-read of the same vector files and conversion to features.
Definition: DtCDBVectorFeature.h:129
Abstract Vector handler class.
Definition: DtCDBVectorFeature.h:41

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)